Re: Quitting an applet?
Re: Quitting an applet?
- Subject: Re: Quitting an applet?
- From: "Marc K. Myers" <email@hidden>
- Date: Wed, 29 Nov 2000 19:49:35 -0500
- Organization: [very little]
Carl West wrote:
>
Date: Wed, 29 Nov 2000 15:46:58 -0500
>
From: Carl West <email@hidden>
>
Organization: VPG Integrated Media
>
To: AppleScriptList <email@hidden>
>
Subject: Quitting an applet?
>
>
I want my script to quit if the user presses a particular button. It's
>
not happening.
>
>
Minimal case:
>
>
on run
>
quit
>
display dialog "it didn't quit"
>
end run
>
>
As a classic applet, it always gets to the "it didn't quit" dialog. In
>
the Script Editor I get the slightly cryptic error "Could not run the
>
script because a script is running" which I take to mean that it can't
>
execute the quit command on the the Script Editor while it has a script running.
>
>
How does one get an applet to stop executing and quit?
In a non-stay-open applet, a "return" in the run handler (implicit or
explicit) will neatly terminate the script. In a stay-open applet, a
"quit" in the idle handler will do the same. Why it works this way I do
not know. I discovered it by trial and error. My guess would be that
"return" returns control to the Finder, but you'd think that a "quit"
would work as well.
Marc [11/29/00 7:47:16 PM]