如何在Mac上用Script啓動quicktime錄製?

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 "QuickTime Player" to start (new movie recording)'

摘自How to start QuickTime recording at command line?

======分割線======

這幾天爲了解決錄製視頻同時記錄開始錄製的時間戳這個需求,倒騰了不少解決方案,之前也想過用命令行打開QuickTime進行錄製,但是忘了還有AppleScript,而且竟然4行就搞定了(捂臉…心痛一下我的時間)。在這裏大概記錄一下之前試過的方法。

1.OpenCV Python 錄製視頻
2. python包裝ffmpeg實現視頻錄製

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章