• 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
Quit Handler... What Am I Missing Here?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Quit Handler... What Am I Missing Here?


  • Subject: Quit Handler... What Am I Missing Here?
  • From: "S. J. Cunningham" <email@hidden>
  • Date: Wed, 11 May 2011 11:58:37 -0400

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.

Thanks.

(*
	Quit Handler Example Case 1: Explicit run handler

	- Works as expected when run from Script Menu as either
		Compiled Data Fork or Compiled Bundle
	- Continue quit ignored when run as an Application Bundle
		either from Finder or Script Menu.
*)

on run {}
	display dialog "Quit Handler Example Case 1: explicit run handler"
	display dialog "Calling quit handler"
	quit
	display dialog "Whoops! Statement following quit in run handler"
end run

on quit {}
	display dialog "quit handler entered"
	try
		set dialogAnswer to display dialog ¬
			"Continue quit?" buttons {"Yes", "No", "Cancel"} ¬
			default button "Yes"
		if button returned of dialogAnswer is "Yes" then
			display dialog "continuing quit"
			continue quit
			display dialog "Statement following continue quit"
		else
			-- your code for No goes here
		end if
	on error number -128 -- userCanceledErr
		-- your code for Cancel goes here
	end try
	display dialog "Exiting quit handler"
end quit



 _______________________________________________
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

  • Follow-Ups:
    • A Note on the Quit Handler
      • From: Luther Fuller <email@hidden>
    • Re: Quit Handler... What Am I Missing Here?
      • From: "S. J. Cunningham" <email@hidden>
    • Re: Quit Handler... What Am I Missing Here?
      • From: Luther Fuller <email@hidden>
    • Re: Quit Handler... What Am I Missing Here?
      • From: Luther Fuller <email@hidden>
  • Prev by Date: Re: Quicktime export using settings file problem
  • Next by Date: Re: Quit Handler... What Am I Missing Here?
  • Previous by thread: Re: quit command
  • Next by thread: Re: Quit Handler... What Am I Missing Here?
  • Index(es):
    • Date
    • Thread