Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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)


tell application "QuickTime Player"
    new screen recording 1
    start document 1
end tell


tell application "QuickTime Player"
    document "Screen Recording" stop
end tell


osascript start-recording.scpt
osascript stop-recording.scpt

Additional info

  1. 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

  2. The error is saying something like this: Quick time cant get document Screen recording. error -1728

  3. the crontab row is

     10 18 * * * /Users/usr1/

    where is the script running both applescripts as shown above

share|improve this question
Which QuickTime Player should the cron job address if several users are logging in at the time and all of them are using QT? – patrix Jan 4 '13 at 17:14
What is the error? and what is the crontab entry? – Mark Jan 4 '13 at 17:17
Whose crontab is this? Which user? – glenn jackman Jan 4 '13 at 19:02
I get the error already when running the two osascript commands from Terminal, hmm. Can you replace the "Screen Recording" part in the stop script with '1' (so it says 'document 1 stop') and try again? – patrix Jan 6 '13 at 11:04
Same problem running via crontab - "QuickTime Player got an error: Can’t get document 1. Invalid index. (-1719)" – ndinev Jan 7 '13 at 9:11

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.