Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 3 of 3
  1. #1
    Join Date
    May 2006
    Posts
    1,443

    how to detect is FolderBrowse cancaled

    hi all

    i.m working on a simple app.
    its only copy files from X folder to Y folder
    i want to detect if user has click Cancel or Ok button on folder dialog,
    i want to do if user has click on Cancel button

    show message " copy canceled "
    do nothing

    and if user has select a folder and click Ok button

    copy files from X folder to selected folder
    show message " save completed"

    i tried this code but its failed on messages
    when canceled nothing was saved but my app. say "save complete"
    how to resolve this issue

    here is similar code of mine


    folder = Dialog.FolderBrowse("Open Folder", "C:\\\\");

    if folder == "" then
    show_message " copy canceled " do nothing
    else
    copy files from X folder to selected folder
    show message " save completed"

    end

    thanks.

  2. #2
    Join Date
    Apr 2005
    Location
    In Wonderworld
    Posts
    246
    let`s Asume you have a test file in root C: called TestFile.txt like this C:\TestFile.txt then you could use this to chosse witch folder to copy this test file to, when folder has been decided and accepted a message will appear asking if user wants to cancel or if the user wants to continue and copy the file to this folder, if user would press ok then file will be copyd to this directory, if user press cancel the file wont be copyd and the script will end.

    Code:
    TargetFolder = Dialog.FolderBrowse("Please select a folder:", _DesktopFolder.."\\");
    result = Dialog.Message("Notice", "Your message here.", MB_OKCANCEL, MB_ICONINFORMATION, MB_DEFBUTTON1);
    if (result == IDOK) then
    File.Copy("C:\\TestFile.txt",TargetFolder.."", true, true, false, true, nil);
    result = Dialog.Message("Notice", "Your message here.", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
    else
    end

  3. #3
    Join Date
    Jul 2006
    Posts
    1
    if cancelled folder = "CANCEL" .......

    folder = Dialog.FolderBrowse("Open Folder", "C:\\\\");

    if folder == "CANCEL" then
    show_message " copy canceled " do nothing
    else
    copy files from X folder to selected folder
    show message " save completed"
    end
    Last edited by jcarmony; 07-20-2006 at 03:49 AM.

Similar Threads

  1. Acrobat.det does not detect that Acrobat is not installed
    By mlupo in forum AutoPlay Media Studio 5.0
    Replies: 2
    Last Post: 07-22-2005, 06:51 AM
  2. detect Acrobat Reader version dynamically
    By andrewr in forum AutoPlay Media Studio 5.0
    Replies: 2
    Last Post: 05-20-2005, 08:24 AM
  3. Detect compressed .tif files
    By TJ_Tigger in forum AutoPlay Media Studio 5.0
    Replies: 3
    Last Post: 07-22-2004, 02:57 PM
  4. Q with detect acrobat and reader
    By lorenhsu1128 in forum AutoPlay Media Studio 5.0
    Replies: 5
    Last Post: 04-21-2004, 06:48 PM
  5. HOWTO: Detect Acrobat Version
    By Support in forum AutoPlay Media Studio 4.0 Examples
    Replies: 0
    Last Post: 10-22-2002, 04:01 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts