I am using some code from AppleScript Studio’s “Open Panel” example for the user to choose a destination folder inside a sheet/panel. After the panel closes it calls the on panel ended handler. Later I discovered that my panelized progress bar would call the same handler when it closed.
on panel ended theObject with result withResult
end on panel ended
So I need to react differently when my progress bar is closing than when the choose destination folder panel is closing.
I was thinking I would have an if block testing theObject since while withResult would be 1 in only one case it could be 0 in both cases. But I’m not sure what the test should be, since the value of theObject isn’t just text.
Can someone suggest the answer?
Values upon entering handler…
After Choose Destination panel:
http://www.automaticduck.com/screenshots/openPanel.jpg
After progress bar closes:
http://www.automaticduck.com/screenshots/windowID2.jpg