Re: Script Application handles an event, then quits
Re: Script Application handles an event, then quits
- Subject: Re: Script Application handles an event, then quits
- From: Richard 23 <email@hidden>
- Date: Fri, 12 Jan 2001 01:02:42 -0800
>
So, to write a script that handles an Apple Event and then exits, the code is
>
simply,
>
>
on eventToHandle from foo into bar given knight:baz
>
-- your code goes here
>
quit
>
end eventToHandle
Good suggestion. Thanks for that.
I usually create a "Stay_Open" property which can be set immediately after
launch. It defaults to false and after a preset (adjustable per something
like Attention_Span or Patience_Limit) period of inactivity the script
quietly quits.
The script library locator I wrote builds a lookup table when in stay open
mode so that subsequent requests for files already located during a single
session are much faster, easing my bitterness during development (since
loaded script objects evaporate every time I recompile.) This cache is
dumped when quitting time comes.
There are some scripts though that would benefit from your suggestion and
I'll look into applying your suggestion.
R23