Trixology
WeatherCat => WeatherCat Feature Requests => Topic started by: elagache on May 12, 2012, 10:14:37 PM
-
Howdy Stu and WeatherCat fans, [cat]
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, the one thing I 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 I have a humble request (I hope.) Could either WeatherCat incorporate a delay so that whatever shutdown application has enough time to "do its thing" before WeatherCat shuts down?
Alternatively, could WeatherCat monitor the process of the shutdown application and not start its own shutdown until the shutdown application has itself quit?
Not sure how to do this but toss out the problem for Stu's clever mind to "chomp on." [computer]
Cheers, Edouard [cheers1]
-
Hi Edouard,
Yes, let me have a think about it and do some investigation - I've added it to the todo list.
Cheers,
Stu.
-
Hi Edouard
For this to work better for me I rearranged on which one shut down first for me
1.WC Status Growler
2.WC Web Data Uploader
3.WC AppleScript Tag Processor
4.WC Storm Monitor
5.WC ET Reporter
6.WC Zambretti Forecaster
7. WC Twitter Uploader
and took out the delay
I'm not telling anyone else to do this but this just worked better for me
[cheers1]
-
Howdy Stu and cat fans,
Yes, let me have a think about it and do some investigation - I've added it to the todo list.
Thanks Stu!
As noted elsewhere, got a workaround in AppleScript so it can indeed be added to your todo list in the usual way.
Might be worth pondering how common this problem would be in the long term. The AppleScripts will need to be somehow redone and a lot the functionally will probably get out of AppleScript completely - so this particular instance of problem may go away. However, I was wondering about folks who might have other physical devices tied into their weather monitoring rig. Mike might need to have have other programs shutdown physical hardware. Also Dan on MacWeather is "gettin' idiers'" about adding hardware. So the need may remain.
Cheers, Edouard [cheers1]
-
Hi Randall, Stu, and WeatherCat fans,
For this to work better for me I rearranged on which one shut down first for me
. . . . . .
Well, that depends on if you have WC Web Data Uploader and WC Twitter Uploader sending requests to WC Status Growler to see if the Internet is up or not. If you do, then there is always a chance either one will restart WC Status Growler before you have shut them down. The same point applies to WC AppleScript Tags Processor.
Now it is true, the longer the delays in the shutdown process, the longer the interval when an AppleScript might make requests to one another or WeatherCat. Now that you mention this, I think I should knock these values way down. Even 1/2 a second is plenty of time and the AppleScript delay command accepts decimals.
Even so, it is still "more better" to have Stop WeatherCat Scripts also shutdown WeatherCat instead of using the WeatherCat shutdown action when using my AppleScripts. Even if the odds can be made very small, there is always a risk that something will be restarted if you don't shut things down in the right order. If you really want to have a bullet-proof sequence, you have to eliminate any such chance. It doesn't matter too much I suppose if you restart things "by hand," but if you want to completely automate a restart process say while your sleeping - you don't want a surprise waiting for you when you check your computer in the morning!! :o
Cheers, Edouard [cheers1]
P.S. On second thought, the situation is even more complicated. Even if the shutdown sequence will work perfectly well, there is a possibility of the processing taking a very long time. The two scripts that upload data to the Internet won't quit in the middle up uploading. AppleScript isn't smart enough to interrupt the idle handler an AppleScript is "told" to quit. If there is a request to an upload service and the server is very slow to respond - both WC Web Data Uploader and WC Twitter Uploader could take as long as a minute to quit. Fortunately, AppleScript doesn't do the next step in the script until the previous one is completed. So Stop WeatherCat Scripts will patiently wait for each script in turn to quit before telling the next one to do to so. Nonetheless, it is possible for this process to take as much as several minutes when your Internet connectivity is poor.
P.P.S. On third thought (why am I thinking so much! (http://www.canebas.org/Weather/LWC_forum/Custom_emoticons/thinking_idea.gif)) I should remove all the delays in Stop WeatherCat Scripts. The way AppleScript processes each line guarantees that nothing will be left incomplete as the shutdown sequence unfolds. The delays are only need for Start WeatherCat Scripts to avoid having WC AppleScript Tags Processor getting requests for all the other AppleScripts at once.
-
Hi Edouard
I see what you mean but I don't use the twitter uploader not a tweeter I was just playing around with it after I ask about the scripts restarting WeatherCat when trying to shut it down and so far it has worked for me I know now that I said this it won't work the next time but that's part of exploring
thanks for all your hard work you and Stu will get it worked out I know
[cheers1]
-
Hi Randall and WeatherCat fans,
I've been scratching my head as I've been scrambling about with the outdoor chores . . . . (http://www.canebas.org/Weather/LWC_forum/Custom_emoticons/scratch_head.gif)
I see what you mean but I don't use the twitter uploader not a tweeter I was just playing around with it after I ask about the scripts restarting WeatherCat when trying to shut it down and so far it has worked for me I know now that I said this it won't work the next time but that's part of exploring
thanks for all your hard work you and Stu will get it worked out I know
Actually, what you've done has a very high probably of working perfectly. Without any delays, there is very little time for a request to "sneak out" and restart anything. I'll modify my version of the script to remove the delays and update the documentation. As long as you aren't using some script to automatically restart WeatherCat, it is silly not to have the convenience of using Stu's handy shutdown action. You may never have a problem, and if you do, it would be months before it would happen again.
However, if you are trying to automate WeatherCat being restarted, my thinking is: "why not use the script instead?" If you are using Automator, CronniX, so something else, you have already got another program involved. It isn't any harder to launch Stop WeatherCat Scripts to do the shutdown action and then launch WeatherCat and use the startup actions to put all the AppleScripts back to work. Also, the idea of having my weather station software broken in some weird state half the night because of a bad restart . . . . that's not a risk I would be willing to take!! :(
So that's my latest thinking on this after watering the shrubs, blowing all the debris, and preparing for the arborists who are coming tomorrow to trim our Sequoia trees. . . . . . Don't know if that is best way to solve this sort of problem, but it will have to do!
Cheers, Edouard [cheers1]
-
Hi Edouard
No I'm not using any other scripts than your startup and shut scripts
It was that it would restart WC before all scripts were to quit so I just rearranged which ones to quit first and took out the delays and was working the last few times i was testing it using your scripts now I wanting to run WC for a week or two with out restarting it to see how stable it is here.
Will your scripts run OK if I shut down Growl while I'm on vacation so that my screen is not full of stickies when i get back or how to turn off the stickies so that they don't stay on the screen?
thanks
[cheers1]
-
Howdy Randall and WeatherCat Voyagers . . . .
No I'm not using any other scripts than your startup and shut scripts
It was that it would restart WC before all scripts were to quit so I just rearranged which ones to quit first and took out the delays and was working the last few times i was testing it using your scripts now I wanting to run WC for a week or two with out restarting it to see how stable it is here.
Okay sounds like to have things under control. I'll revise my stop script along the lines you suggest as I noted earlier.
Will your scripts run OK if I shut down Growl while I'm on vacation so that my screen is not full of stickies
In a word - NO!!
how to turn off the stickies so that they don't stay on the screen?
Shucks Randall, with my wagon on injured reserve, I haven't thought about such things!! ;D
So, a quick bit of research. In your case, the easiest thing to do is to use the "master control switch" and turn off all notifications all together. You can do that on the General tab of the Growl preference pane. Here is an image of what that looks like:
(https://img.skitch.com/20120514-xp7kkpkdxhkwsjdejt4s1gx54y.jpg)
You can also do the same thing for individual applications without turning off everything. Here is a screenshot for Growl 1.2 that shows what to do:
(https://img.skitch.com/20120514-jhjc8ek26hnr9ww1q78my2dk15.jpg)
For each AppleScript application, uncheck the box in the Growl preference pane. The scripts will then run as they always do. Growl will simply not create a notification when the AppleScript asks.
Whether you stop the notifications at the "master switch" or on an application by application basis, When you get back from vacation, check the box (or boxes) and the AppleScript will resume giving you notifications with Growl.
Hope that's clear and straightforward enough!!
Cheers, Edouard [cheers1]
-
Hi Edouard
That's what I thought but wanted to hear it from the expert
If don't ask you won't know for sure
thanks
[cheers1]
-
Hi Randall and WeatherCat fans, [cat]
That's what I thought but wanted to hear it from the expert
If don't ask you won't know for sure
To be honest, I had noticed those things before but never bothered to figure out how they worked - never had a need for it! :o
Does that mean I'm overdue for a vacation? 8)
Cheers, Edouard [cheers1]
-
Edouard
As soon as the big block is in and purring its time [biggrin]
[cheers1]
Mine will be a working vacation to fix what ever mom needs done 928 miles and 15 hrs and 40 minutes of straight driving if no problems
[cheers1]
-
Howdy Randall and WeatherCat voyagers . . . .
Mine will be a working vacation to fix what ever mom needs done 928 miles and 15 hrs and 40 minutes of straight driving if no problems
;) Huh??? . . . that's what you call a vacation? (http://www.canebas.org/Weather/LWC_forum/Custom_emoticons/scratch_head.gif)
Ya' know, I don't think you've got the concept down right exactly . . . . maybe you should check out the Wikipedia entry (http://en.wikipedia.org/wiki/Vacation) on this one!!
Otherwise, as soon as you finish your "vacation" . . . . ya' know what you'll be needing? . . . . . . a real vacation!! [lol2]
Cheers, Edouard [cheers1]
P.S. Sure is getting frightening what you can find on Wikipedia!! :o
-
Hi Edouard,
Nothing obvious has sprung up - the issue is that WeatherCat can launch anything on shutdown - it may not be something it can monitor. I think we'll have to come up with some mechanism to manage it that might involve some coordination between WeatherCat and script to coordinate things.
I'm just off camping for a few days, but when I get back will have a play to see what I can come up with (I'll probably drop you an email when I have something).
Cheers,
Stu.
Good luck with the trip Randall! We're towing 200 miles tomorrow, not sure I could manage 928 miles :)
-
Howdy Stu and feline adventurers! [cat]
Nothing obvious has sprung up - the issue is that WeatherCat can launch anything on shutdown - it may not be something it can monitor. I think we'll have to come up with some mechanism to manage it that might involve some coordination between WeatherCat and script to coordinate things.
Well, I had a simple-minded UNIX-styled mechanism in my head. We can toss that idea around when you get back.
I'm just off camping for a few days. . . . . We're towing 200 miles tomorrow. . . .
Enjoy the expedition!!! You are making me ever more anxious to get my trusty wagon back into service!! (http://www.canebas.org/Automotive/V8_Buick/Misc/Biquette_V8_Buick_signature.gif)
Cheers, Edouard [cheers1]
-
Hi Edouard and Stu
Stu have a safe and enjoyable trip watch them brakes
And for my trip is about half way to your house Edouard will work for a few days but then relax with all the family, the rest of the time lots of good food and drink and we will get the guitars out and have a evening jam or two there will be about ten of us playing
And Edouard just get in that wagon and go then and later this fall I will go on a real vacation to a place just to relax
[cheers1]
-
Howdy Randall and WeatherCat vacationers,
And for my trip is about half way to your house Edouard will work for a few days but then relax with all the family, the rest of the time lots of good food and drink and we will get the guitars out and have a evening jam or two there will be about ten of us playing
Well, I sure hope there aren't any piles of woodchips waiting for you. I just spent two hours "distributing" a pile around the yard and . . . . I suspect I'll be "remembering" this chore tomorrow morning! (http://www.canebas.org/Weather/LWC_forum/Custom_emoticons/clonk_head.gif)
Glad your trip won't be all work and no play . . . . specially when it comes to playing your guitar!! [rock]
Have a nice time Randall!! [bounce]
Cheers, Edouard [cheers1]