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

Re: Quit Handler... What Am I Missing Here?


  • Subject: Re: Quit Handler... What Am I Missing Here?
  • From: Luther Fuller <email@hidden>
  • Date: Wed, 11 May 2011 12:05:12 -0500

On May 11, 2011, at 10:58 AM, S. J. Cunningham wrote:

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.

I played with your script for a few minutes and I think it will run as you expect if you add

error number -128 

at the end if the 'quit' handler. But that's probably not a good idea.
My standard 'run' handler for any application always looks like this ...

on run
try
my main()
on error errText number errNr
if errNr = -128 then
return --> quit handler
else if errNr = -2700 then
my showInstruction(errText)
else
my showError(errText, errNr)
end if
end try
end run -------------------------------------------------------

If you need to stop your script at some point, for any reason,
no matter how deeply nested in handlers, simply write ...

error number -128

which returns your script to the 'run' handler, then the 'quit' handler.

 _______________________________________________
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: Quit Handler... What Am I Missing Here?
  • Next by Date: Re: Quit Handler... What Am I Missing Here?
  • Previous by thread: Quit Handler... What Am I Missing Here?
  • Next by thread: Re: Quit Handler... What Am I Missing Here?
  • Index(es):
    • Date
    • Thread