Re: Quit Handler... What Am I Missing Here?
Re: Quit Handler... What Am I Missing Here?
- Subject: Re: Quit Handler... What Am I Missing Here?
- From: Deivy Petrescu <email@hidden>
- Date: Sat, 14 May 2011 10:34:05 -0400
On May 13, 2011, at 4:57 PM, S. J. Cunningham wrote:
>> Le 12 mai 2011 à 14:06, S. J. Cunningham a écrit :
>>
>>> Forgive the top post, but I am apparently still not asking my question clearly. Let me try again :-)
>>>
>>> I have a script compiled as an application which runs in an infinite loop, checking a website for changes every so often (Woot during a Woot-Off, if you must know). Like a total noob, I assumed that if I selected "Quit" from the running script's application menu, it would execute the quit handler and, well, quit. It doesn't. The only way I can quit the application is to Force Quit it and that leaves files open that the quit handler was supposed to clean up. This seems like a bug to me.
>>
>> Right, the quit handler will be executed, but your script has still a lot to achieve, because of the infinite loop.
>>
>> That is, the script will resume at the point it was in the loop and the application won't quit.
>
> "When I use a word," Humpty Dumpty said in rather a scornful tone. "It means just what I choose it to mean - neither more or less."
> "The question is," said Alice, "whether you can make words mean so many different things."
> "The question is," said Humpty Dumpty, "which is to be master - that's all."
>
> I'm sorry, but this just seems to be really bizarre behavior for something labeled "quit". I guess it's just me :-) I shudder to think what "continue" might mean :-)
>
> Might be an interesting defense:
>
> Prosecutor: "She said 'quit!' "
> Defendant: "Yes, but I wasn't done." _______________________________________________
> Do not post admin requests to the list. They will be ignored.
I disagree with you here.
"quit" is an event you send. If you trap it it will do different things according to how you trapped.
The quit handler is not really necessary, it is there for you to d some clean house when the app is closing.
If you do not need any cleaning house don't use.
The same is true with error number -128, it stops the execution of a script, but if you trap it, as in your example, it will also do other stuff.
There is no change in the meaning, what is happening is that you are giving confusing orders to your script, quit, but also display a dialog, then display another dialog and then…
You are lucky your script can not respond back to you, or it would say "Do you really want me to quit? then stopping giving me other commands…"
Deivy Petrescu
email@hidden
_______________________________________________
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