MacOs 10.8.2 I have 2 applescripts shown below. They are arranged in one shell script to run one after another by using osascript (just to simplify the example). Everything works fine when starting shell script form the console. However if the same script scheduled in crontab I get an error from the second script.(First run just fine)
STAR-RECORDING SCRIPT
tell application "QuickTime Player"
activate
new screen recording 1
start document 1
end tell
STOP-RECORDING SCRIPT
tell application "QuickTime Player"
activate
document "Screen Recording" stop
end tell
THE SHELL SCRIPT
osascript start-recording.scpt
osascript stop-recording.scpt
Additional info
There is only one user loged in the system. Cronjob is executed for him as well. I can visually confirm that recording was started after first scipt is executed
The error is saying something like this:
Quick time cant get document Screen recording. error -1728the crontab row is
10 18 * * * /Users/usr1/test.shwhere test.sh is the script running both applescripts as shown above