【发布时间】:2020-04-03 10:54:39
【问题描述】:
我正在寻找使用 Applescript 控制 Quicktime 的解决方案。 我需要做的就是—— - 打开 quicktime 并开始录制 - 停止录制并将文件保存到设定的位置。
从以前的帖子中,我设法得到了以下信息。
set theFilePath to "/Users/jamestebb/Desktop/01TestRecords/ " & "myfile" & ".mov"
tell application "QuickTime Player"
set newMovieRecording to new movie recording
tell newMovieRecording
start
delay 5
pause
save newMovieRecording in POSIX file theFilePath
stop
close newMovieRecording
end
这非常有效,但是对于这个项目,我需要单独的脚本提示来开始和停止录制,而不是等待/延迟。
开始我使用的录音。
set theFilePath to "/Users/jamestebb/Desktop/01TestRecords/ " & "myfile" & ".mov"
tell application "QuickTime Player"
set newMovieRecording to new movie recording
tell newMovieRecording
start
end tell
end tell
这很好,但是当我尝试使用下面的方法停止录制时,我会收到不理解暂停的错误
set theFilePath to "/Users/jamestebb/Desktop/01TestRecords/ " & "myfile" & ".mov"
tell application "QuickTime Player"
set MovieRecording to new movie recording
tell MovieRecording
pause
save MovieRecording in POSIX file theFilePath
stop
close MovieRecording
end tell
end tell
我猜这是因为当前录制的文件不再是“新电影录制”
任何想法很快如何解决??
【问题讨论】:
标签: applescript quicktime