jalves wrote:dejees wrote:For what it's worth, I have an applescript that I run daily as a CRON job.
- Code: Select all
try
tell application "Indigo 6"
quit
end tell
end try
try
tell application "IndigoServer"
quit
end tell
delay 300
run application "Indigo 6"
delay 120
tell application "Indigo 6"
quit
end tell
end try
I guess I don't understand Applescript (no surprise). Can you tell me in layman's terms what this is doing? I see three things happening, but don't know when/why.
Also, how do you include this as a chron job?
howarth described it perfectly. There are multiple steps being accomplished in the applescript. It runs on the same MAC as the Indigo Server, first it closes the Indigo 6 client, just in case I left it running previously, then it politely tries to quit Indigo 6 Server, then waits 5 minutes just to be sure everything shuts down, then restarts my local client on the Mac, which in turn starts the server if it is not currently running, which should be the case since earlier in the script we shout it all down. Next we wait 2 more minutes, giving more than enough time for everything to start, and close the client portion leaving the Indigo server active.
Since this script lives outside of Indigo and is designed to stop/restart it, I used a CRON job to schedule it to run. You can read about CRON on Mac's at the following article at Maclife
http://www.maclife.com/article/columns/terminal_101_creating_cron_jobs