Re: Quit Handler... What Am I Missing Here?
Re: Quit Handler... What Am I Missing Here?
- Subject: Re: Quit Handler... What Am I Missing Here?
- From: Luther Fuller <email@hidden>
- Date: Wed, 11 May 2011 12:05:12 -0500
On May 11, 2011, at 10:58 AM, S. J. Cunningham wrote: OS X 10.6.7. I want to run a script as an application but I can't seem to get the quit handler to quit. Seems to me it used to work this way but maybe my memory is faulty. Or maybe Snow Leopard changed something. Anyway, here is the sample script I am running. I get the same behavior with an implicit run handler. Help appreciated.
I played with your script for a few minutes and I think it will run as you expect if you add
at the end if the 'quit' handler. But that's probably not a good idea. My standard 'run' handler for any application always looks like this ...
on run try my main() on error errText number errNr if errNr = -128 then return --> quit handler else if errNr = -2700 then my showInstruction(errText) else my showError(errText, errNr) end if end try end run -------------------------------------------------------
If you need to stop your script at some point, for any reason, no matter how deeply nested in handlers, simply write ...
which returns your script to the 'run' handler, then the 'quit' handler.
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden