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: "Stockly, Ed" <email@hidden>
- Date: Wed, 11 May 2011 19:09:41 -0500
- Acceptlanguage: en-US
- Thread-topic: Quit Handler... What Am I Missing Here?
> on run {}
> repeat while (true)
> end repeat
> display dialog "Whoops! Statement following quit in run handler"
> end run
>
> on quit {}
> continue quit
> end quit
Try saving this one as an app. (Not a stay-open app).
------
on run {}
display alert "Starting Up"
repeat while (true)
end repeat
display alert "Whoops! Statement following quit in run handler"
end run
on quit {}
display alert "About to Quit!"
continue quit
display alert "Trying to quit!"
end quit
------
When you hit Quit from the menu you get the About to quit alert, then the
trying to quit alert, then beachball. It will quit with command-period
If you hit command-period from the start, without trying to quit, you get
both alerts but it quits.
Here's something that works, but your app must be a stay open app.
------
on run {}
display alert "Starting Up"
end run
on quit {}
display alert "About to Quit!"
continue quit
display alert "Trying to quit!"
return
end quit
on idle
return 1
end idle
------
Not every script can be structured with an idle handler, but if yours can,
this will work. Not sure why the "Trying to quit" alert displays. Maybe the
continue command doesn't work the way I thought.
HTH,
ES
_______________________________________________
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