Dear WeatherCat AppleScript fans,
Yeah I should have tried this before but . . .
insert here the usual lament about lack of time . . . .
Today was my first attempt to use WeatherCat to launch and shutdown all my AppleScripts using the launcher scripts I wrote. Launching works just fine. Alas, shutting down runs into a problem. I have pauses so that all the dependent AppleScripts shut down before the two AppleScripts that are used by others quit. I do this to avoid this problem of one AppleScripts accidentially launching another which is in the process of being shutdown.
Unfortunately, If you launch
Stop WeatherCat Scripts as the shutdown action from WeatherCat, one thing you cannot "delay" is WeatherCat itself shutting down. Sure enough, WeatherCat has completely quit before my AppleScripts have. During the delay at least one of the AppleScripts sends an AppleScript request that - causes WeatherCat to automatically start up again . . . .
So the seemingly obvious idea of making
Stop WeatherCat Scripts the shutdown action won't do at all what you want. Instead it will cause WeatherCat to restart - not finally quit.
You have two options. You can either run
Stop WeatherCat Scripts manually just before stopping WeatherCat, or you could have the AppleScript shut WeatherCat instead having WeatherCat control the operation. To do that you could add the following line at the bottom of
Stop WeatherCat Scripts:
tell application "WeatherCat" to quit
Then when you launch
Stop WeatherCat Scripts, the last action it would do is shutdown WeatherCat itself.
Since I normally shutdown WeatherCat "by hand" saving one action to quit isn't worth the trouble for me. However, if you want to automate your start up and shutdown processes, adding that line above should make it possible to shutdown using something like Automator.
By the way, the AppleScript command:
tell application "WeatherCat" to activate
Causes WeatherCat to launch without that problem of the startup window remaining open. This line could be used in some sort of an automated start sequence if using Automator directly is a nuisance.
Cheers, Edouard