• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Quitting from an idle handler
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Quitting from an idle handler
      • From: "J. Stewart" <email@hidden>
  • Prev by Date: Mail and Attachments
  • Next by Date: Re: When is a file open but not open?
  • Previous by thread: Re: Mail and Attachments
  • Next by thread: Re: Quitting from an idle handler
  • Index(es):
    • Date
    • Thread