I am trying in vain to get cron to run AppleScripts. For the moment I just have a short script that opens access to a file, writes something to it and closes the file again. I can get the script to work from the command line, but it doesn’t appear to work from cron.
I have the script saved as an application bundle (at the moment, I have tried other options) . When I run it from the commandline as “open /testscript” (it is just on the root of the drive) I get a dialog box asking me whether to run or quit the script, which is undesirable. If I run the script as osascript /testscript the scripts completes successfully and without the dialog. Now I just need that to happen using cron.
I have editied the system crontab and added the command as osascript /testscript running as root and I have set the command to run a few times on every day at just a few minutes from when I save the script. For example, I put “16,17,18,19” in the first field if it is now 15 minutes after the hour with * for all the other date entries, hoping the script will kick in after I close the crontab and run 4 times. I have explicitly set permissions on the file to 755 thinking there might be a permissions issue, but no go.
If anyone has info to share on getting Applescript to play with cron I would really appreciate it.
Running the script on a G5 with 10.4.3
cheers