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: "S. J. Cunningham" <email@hidden>
- Date: Fri, 15 Jan 2016 16:28:55 -0500
On Jan 15, 2016, at 5:23 AM, Nigel Garvey wrote:
> "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
I am amazed I never noticed this before. I'm sure I have used the quit command many times. I guess I just never had anything after it that I noticed.
Kind of makes you wonder what the point of a "quit" command that doesn't quit is. Or was.
Unfortunately, I need the script to run unattended so answering a display dialog isn't going to work.
Maybe i'll have to use a do shell command to kill it.
Steve
------------------
OS X 10.6.8, AppleScript 2.1.2
_______________________________________________
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