12

How to start QuickTime video recording on a MacBook at the command line?

2 Answers 2

16

1) Create a Applescript by AppleScript Editor and save it (e.g. QTRecord.scpt):

 tell application "QuickTime Player"
     activate
     start (new movie recording)
 end tell

2) Open Terminal and run the script in command line:

 osascript QTRecord.scpt 

Or the whole thing as an one-liner:

 osascript -e 'tell application "QuickTime Player" to activate' -e 'tell application "QuickTime Player" to start (new movie recording)'
3
  • How do you know those parameters ? Apple script editor 'Record' function, don't provide that... @ohho
    – CodeFarmer
    Jul 12, 2016 at 5:49
  • 2
    @CodeFarmer Using Xcode, open QuickTImePlayerX.sdef, located Inside the Contents folder of the Quicktime Player X package.
    – James Bush
    Dec 2, 2016 at 9:49
  • Another way to check the commands in a more readable way is to open the .app bundle in Script Editor using File → Open Dictionary...
    – grego
    Jan 20, 2022 at 21:18
2

According to this site, it can be done using Applescript

tell application "QuickTime Player"

    set nr to (new movie recording)
    set nr to start recording true
    delay 10
    set nr to stop recording true
end tell

So it interacts with Quick-time. There are no direct commands with QuickTime.

1
  • Compiling the above code gives a syntax error: Expected end of line, etc. but found “true”.
    – ohho
    Jun 19, 2012 at 1:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.