• 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
A Note on the Quit Handler
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

A Note on the Quit Handler


  • Subject: A Note on the Quit Handler
  • From: Luther Fuller <email@hidden>
  • Date: Fri, 13 May 2011 15:18:21 -0500

The recent discussion "Quit Handler... What Am I Missing Here?" prompted me to take advantage of an opportunity to run a test on the 'quit' handler. This afternoon I was writing a small application, to be located in the host application's /Contents/Resources/ folder, whose only purpose was to call an entry-point handler in the host application.

The script of the calling application is ...

-- this application located in /Application/Contents/Resources/
on run
tell application "Finder" to set hostAppl to (container of container of container of (path to me)) as text
launch application hostAppl
tell application hostAppl to entryPointHandler()
end run -----------------------------

The entry-point handler in the host application is ...

on entryPointHandler()
try
--
-- do stuff and call other handlers here
--
on error errText number errNr
if errNr = -128 then
return
else if errNr = -2700 then
my showInstruction(errText)
else
my showError(errText, errNr)
end if
end try
end entryPointHandler ----------------------------------

The question is: If the host application contains a 'quit' handler, does it run when 'entryPointHandler' is complete?

A quick test confirms that the answer is ... Yes!

(And why, you might ask, would I want to hide an application within a host application? I fill a folder with aliases to these hidden applications and install the folder in the Dock. Now I have a menu to control the host application.)

 _______________________________________________
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

References: 
 >Quit Handler... What Am I Missing Here? (From: "S. J. Cunningham" <email@hidden>)

  • Prev by Date: Importing addresses and passwords into Mail
  • Next by Date: Re: Quit Handler... What Am I Missing Here?
  • Previous by thread: Re: Quit Handler... What Am I Missing Here?
  • Next by thread: RE: Quit Handler... What Am I Missing Here?
  • Index(es):
    • Date
    • Thread