Re: Looking for Design Suggestions
Re: Looking for Design Suggestions
- Subject: Re: Looking for Design Suggestions
- From: Steve Bird <email@hidden>
- Date: Sun, 01 Nov 2015 11:24:33 -0500
> On Nov 1, 2015, at 8:37 AM, S. J. Cunningham <email@hidden> wrote:
>
> I have a script app which I want to run synchronously every two hours. However, I also want it to wake up on demand to respond to manual requests. One of those requests is for it to go into an Alarm State where it changes it's synchronous period from two hours to two minutes and then changes back to two hours once an All Clear signal has been received.
>
> I have been proceeding down the launchd, Stay-Open Agent path because of it's ability to both cycle synchronously and respond asynchronously to changes in a folder or to a "run" command from another app. However changing the cycle from two hours to two minutes is problematic. The only way I can see to do it is to unload the 2 hour plist and then reload a 2 minute plist and vice versa when I want to revert to two hours. However unloading causes the app and any it has spawned to quit. That is problematic.
Consider having it run every two minutes, regardless, but keep your 2-hour count internally.
i.e., every time you wake up, you count down. If you hit zero, do your work.
If you’re in the “quick” state, set the count down to 1, so that you work on the next wake.
If you’re in the “slow” state, set the count down to 60.
----------------------------------------------------------------
Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
www.Culverson.com (toll free) 1-877-676-8175
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden