Quitting from an idle handler
Quitting from an idle handler
- Subject: Quitting from an idle handler
- From: Gil Dawson <email@hidden>
- Date: Sat, 6 Aug 2005 08:09:29 -0700
If my idle handler (waiting for another process to finish) detects an
unrecoverable error, I want it to put up an error message then quit.
I was a little surprised to realize that I cannot use the "error"
command to put up the error message because it will stop execution
prior to the "tell me to quit" instruction, and the idle handler will
simply execute again on the next cycle.
Below is what I came up with. Is there a better way?
BTW, are we fairly settled that coding an idle handler like this is
less CPU-intensive than a delay command?
MacOS 10.4.2, Smile 2.6.9
--Gil
display dialog "Run handler"
on idle
display dialog "Idle handler" buttons {"Error", "Cancel", "OK"}
if button returned of result is "Error" then
FatalError("Fatal error.")
end if
return 3
end idle
on FatalError(msg)
display dialog msg buttons "OK" with icon stop
tell me to quit
end FatalError
_______________________________________________
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