Re: Why Doesn't This Script.app Quit?
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