Looking for Design Suggestions
Looking for Design Suggestions
- Subject: Looking for Design Suggestions
- From: "S. J. Cunningham" <email@hidden>
- Date: Sun, 01 Nov 2015 08:37:47 -0500
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.
A different design would be to use an idle loop in the app itself to cycle rather than launchd. I could still issue run commands to the app while it was idle, either manually or via a Folder Watcher script (although I have have seen some bad comments regarding Folder Watcher's reliability). However, as far as I can tell, there is no way to change the cycle time from two hours to two minutes until the current two hour cycle completes.
I would appreciate any suggestions to extricate myself from this conundrum.
Steve
------------------
OS X 10.6.8, AppleScript 2.1.2
_______________________________________________
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