1)创建AppleScript文件,输入一下代码并保存。如QTRecord.scpt
tell application "QuickTime Player"
activate
start (new movie recording)
end tell
2)在终端执行
osascript QTRecord.scpt
3)或者也可以一句话搞定以上两步
osascript -e 'tell application "QuickTime Player" to activate' -e 'tell application