Re: Quitting from an idle handler
Re: Quitting from an idle handler
- Subject: Re: Quitting from an idle handler
- From: "J. Stewart" <email@hidden>
- Date: Mon, 8 Aug 2005 08:02:03 -0400
On 08/07/05 at -0700 Gil Dawson said this
>Consider the following saved as a stay-open application:
>
>FatalError("Please stop.")
>
>on FatalError(msg)
> display dialog "Fatal Error:" & msg buttons "OK" with icon stop
> tell me to quit
> error "He didn't quit. "
>end FatalError
>
>I am using Smile 2.6.9 and MacOS 10.4.2. When launched on my machine
>by double-clicking its icon, this little script displays the "Fatal
>error: "Please stop." dialog, then another dialog with "He didn't
>quit". After that it does nothing, but remains an active process
>with an icon in my dock.
>
>I don't want it to remain an active process. I want it to quit.
>
>How can I get it to quit?
This works in this particular instance OMM.
FatalError("Please stop.")
on FatalError(msg)
display dialog "Fatal Error:" & msg buttons "OK" with icon stop
error number -128
error "He didn't quit. "
end FatalError
The "error number -128" line produces a user cancelled error which causes this script to exit. It may work in your script.
I must admit to being a bit curious as to why you would want/need to write a custom error handler when there is a built in construct that will usually do a better job of it. Try - on error's sole purpose is to deal with errors. It can notify, ignore, supply alternative methods and of course, bail out.
JBS
--
42.7 percent of all statistics are made up on the spot.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden