Re: quitting an applet
Re: quitting an applet
>
AppleScript isn't multi-threaded and doesn't handle Apple Events and also
>
run at
>
the same time. You need to get rid of the repeat loop, and let the idle
>
handler
>
do the looping for you. That way, when other scripts send Apple Events to
>
your
>
script application, its applet shell will be able to receive the event and
>
dispatch it or handle it properly. (Note that telling a script
>
application to
>
set one of its properties is just like sending a command to a "set"
>
handler of
>
the script. Its just that the "set" handler is built in to the applet
>
shell and
>
so doesn't appear in your script.)
>
>
So, your script would look like this.
>
>
on idle
>
-- do your stuff here
>
if some property is false then quit
>
return 1 -- time to wait for next idle loop
>
end idle
thanks ..Does this mean that I write my script
init stuff (that runs one time)
on idle
everything else
end idle
and I save this as a stay open or normal applet?
tia
Doug