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: "S. J. Cunningham" <email@hidden>
- Date: Wed, 11 May 2011 19:36:51 -0400
On May 11, 2011, at 3:50 PM, Luther Fuller wrote:
> On May 11, 2011, at 2:40 PM, S. J. Cunningham wrote:
>
>> Just a clarification: all the "try's" and "display dialogs" were to help me try to figure out what is going on. My understanding is that I should see nothing after executing "continue quit". The fact that I do is the problem.
>>
>> That is to say the simple script:
>>
>>> on run {}
>>> quit
>>> display dialog "Whoops! Statement following quit in run handler"
>>> end run
>>>
>>> on quit {}
>>> continue quit
>>> end quit
>>
>>
>> Should never display the "Whoops" message and yet it does when compiled as an application. Thus, if I change the run handler to be an infinite loop, I can't quit the application from the application's menu.
>
> And I'm thinking you should never explicitly call the 'quit' handler from the 'run' handler. The 'run' handler, when completed, always goes to the 'quit' handler, if it's there. In other words ...
>
> on run
> -- do stuff
> --> quit handler
> end run
Well, this doesn't work either. When you select "quit" from the Application menu, it just keeps running:
-- Simple quit test
on run {}
repeat while (true)
end repeat
display dialog "Whoops! Statement following quit in run handler"
end run
on quit {}
continue quit
end quit
_______________________________________________
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