I want to use this script to load files, but I also want the script to continue when the user cancels the load process by clicking cancel.
Right now the script catches the cancel error and displays “user cancelled” but the script stops there, and the script stops.
If a file is selected then the display dialog is run and the rest of the script continues.
How can I get a user cancel to let the script continue?
Much thanks for any help.
Mark
try
set lfile to (choose file) as text
on error error_message number error_number
if the error_number is -128 then
beep
display dialog error_message buttons {"Cancel"} default button 1
end if
end try
display dialog "this should happen after error but doesn't"
display dialog "the script only continues if a file is selected"
--and there's more script here I want to continue