after opening “Automator” and spending 2 minutes dragging and dropping actions I though no this need to be done with AppleScript !
Then looking at the fact the AppleScript would need to run constantly I thought this is best for a Cron job!
Looking at apples tech docs Cron is being depricated!
Right so the replacement is to use Launch Daemons and Agents !
So I want to exit and re launch an app called EvoCam every 6 hours, my solution is to create 8 plist files the logic is:
24 / 6 = 4
and I want it to Exit EvoCam on the hour and re open it every 1 minute passed the hour.
so 2 * 4 = 8
To exit EvoCam:
I saved this file to (where ~ is your user directory):
~/Library/LaunchAgents/com.exit.evocam.1.plist
[cc lang=”xml” tab_size=”2″ lines=”40″]
To Launch EvoCam:
Saved this to :
~/Library/LaunchAgents/com.launch.evocam.1.plist
[cc lang=”xml” tab_size=”2″ lines=”40″]
Then duplicate each file 4 times advancing the Hour by 6 , so it quits the app every 6 hours and opens it at every one minute past.
Maybe someone can explain hot to get the .plist file to Loop every 6 hours?
For now this will do!
Obviously you change “EvoCam to the name of the app or program you want to launch.