So, I have a script that works pretty well as a vanilla AppleScript. I have ported it over to AppleScript Studio and built a nib and all that. I left some Display Dialogs and some Choose from List lines of code. They work well in the new Studio App, except if someone clicks “Cancel”. Then I get an error. I’ve tried to put the erroring section in to a Try block…didn’t help.
How can I get this to work?
Here’s a portion of the code (without the try block):
on clicked theObject
if the name of theObject is "Stop" then quit
if the name of theObject is "Check Out" then
tell application "Finder"
set MasterProjectList to (name of every file of folder "Master Project Files" of folder Editorial)
set f to {}
set fname to {}
-- set f to (choose file with prompt "Pick a FCP Project File to Check Out")
set fname to (choose from list MasterProjectList with prompt "Pick a FCP Project File to Check Out")
set f to (every file of folder "Master Project Files" of folder Editorial whose name is fname) as alias
set originalPath to POSIX path of f
--set originalPath to POSIX path of f
if originalPath ends with "/" then set originalPath to text 1 thru -2 of originalPath
Etc. Etc. with code. The error comes up if I hit cancel on “Pick a FCP Project File to Check Out”.
I also tried to put a “if fname = false then quit” etc.