• 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: Why Doesn't This Script.app Quit?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Why Doesn't This Script.app Quit?


  • Subject: Re: Why Doesn't This Script.app Quit?
  • From: Nigel Garvey <email@hidden>
  • Date: Fri, 15 Jan 2016 10:23:02 +0000

"S. J. Cunningham" wrote on Thu, 14 Jan 2016 16:08:48 -0500:

>Why doesn't this sucker quit?  First I tried "return" and then "quit".
>I also tried a quit handler with "continue quit".  It just laughs at me.
>
>on run
>	try
>		error "Oopsie!" number 666
>	on error errMsg number errNum
>		display dialog "Error " & errNum & ": " & errMsg
>		tell me to quit
>	end try
>	display dialog "Hah Hah Hah!  You can't kill me!"
>end run
>
>
>Steve
>------------------
>OS X 10.6.8, AppleScript 2.1.2

Hi.

When an application's told to quit, it's supposed to do so tidily,
completing any tasks it's currently performing, dealing with any unsaved
documents or settings, etc. before actually bowing out.

In the case of a script applet, the task it's currently performing is
running the script. It used to be that an applet told to quit in the
middle of a script wouldn't actually quit until the script had
completed. To get it to quit immediately, one had to stop the script too
with a "User canceled." error:

  on run
    try
      error "Oopsie!" number 666
    on error errMsg number errNum
      display dialog "Error " & errNum & ": " & errMsg
      tell me to quit -- Issue the 'quit' command …
      error number -128 -- … then stop the script.
    end try
    display dialog "Hah Hah Hah!  You can't kill me!"
  end run

I didn't realise things had changed until I tried out your script on my
El Capitan machine. Presumably applets now understand 'quit' to mean
'without executing any more script commands'.

NG

 _______________________________________________
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:
    • Re: Why Doesn't This Script.app Quit?
      • From: "S. J. Cunningham" <email@hidden>
  • Prev by Date: Re: Why Doesn't This Script.app Quit?
  • Next by Date: Re: Grammar Police in OS X 10.11
  • Previous by thread: Re: Why Doesn't This Script.app Quit?
  • Next by thread: Re: Why Doesn't This Script.app Quit?
  • Index(es):
    • Date
    • Thread