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.)