我試圖寫一個小的AppleScript的一個項目,我必須:的AppleScript:QuickTime影片記錄自動保存後,它的完成錄音
- 啓動QuickTime影片記錄
- 減少記錄的窗口
- 打開的影片,將自己放到全屏
- 一旦影片播放完畢,記錄應停止
- 的記錄本身應該保存在背景文件名爲「當前日期和時間」
- 關閉正在播放
- 在Safari中打開一個網站的電影。
這是我設法到目前爲止做:
set theDate to current date
set filePath to (path to desktop as text)
tell application "QuickTime Player"
activate
set newMovieRecording to new movie recording
tell newMovieRecording
start
tell application "QuickTime Player"
set miniaturized of window 1 to true
end tell
tell application "QuickTime Player"
open file "Users:test:Desktop:Movie.m4v"
tell document "Movie.m4v" to play
set the bounds of the first window to {0, 0, 1800, 1100} -- I did not find how to put the window in full screen (whatever the screen size is: I wrote this script on an external screen , but the project will take place on the screen of a laptop).
end tell
delay 160 -- the length of the movie
save newMovieRecording in file (filePath) & theDate
stop
close newMovieRecording
tell application "QuickTime Player"
close document "Movie.m4v"
end tell
end tell
end tell
tell application "Safari"
activate
open location "http://stackoverflow.com"
end tell
上述腳本是隻要我能得到:當影片記錄應該自己救自己,我得到了以下信息AppleScript的編輯:「AppleScript的錯誤 - QuickTime播放器得到了一個錯誤:無效的鍵的形式。」
在此先感謝您的幫助。
使用'present'發揮你的電影全屏(而不是'play'。 ) – 2013-11-05 19:36:06