• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Script Application handles an event, then quits
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Prev by Date: Re: Storing script objects
  • Next by Date: Re: Stay Open
  • Previous by thread: Re: Script Application handles an event, then quits
  • Next by thread: Storing script objects
  • Index(es):
    • Date
    • Thread