2 Replies Latest reply on Dec 12, 2009 5:08 PM by jla_1

    Cancel custom dialog window gracefully



      Cancel custom dialog window gracefully


      I have the following script attached to a button to export images to a folder.  When the user clicks 'cancel' on the first dialog, it still continues on to the moodialog.  Cancelling that still continues to run the script and generates continual errors that the image cannot be created.  How can get the script/dialog to shut down gracefully and stop after the first cancel? 
      • Show Custom Dialog [ Title: "Export Images to Folder"; Message:"Will export the " & Get ( FoundCount ) & " images of the foundset to a folder. You can create the folder in the next menu if youdon't already have it."; Buttons: “OK”, “Cancel” ]
      • Set Field [ IMAGES::_gSelectedFolder; Moo_DialogFolder(IMAGES::_gSelectedFolder;True) ]
      • Set Variable [ $path; Value:IMAGES::_gSelectedFolder ]
      • Go to Record/Request/Page[ First ]
      • Loop
      • Set Variable [ $file; Value:"filewin:/" & $path & "/" & GetAsText ( IMAGES::IMAGE1) ]
      • Export Field Contents [ IMAGES::IMAGEDISPLAYX; “$file” ]
      • Go to Record/Request/Page[ Next; Exit after last ]
      • End Loop