我正在尝试编写一个小的AppleScript项目,需要实现以下功能:
上述脚本是我能够得到的:当电影录制应该保存时,苹果脚本编辑器会显示以下信息:“AppleScript错误 - QuickTime Player出现错误:无效的键形式。”
提前感谢任何帮助。
- 开始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错误 - QuickTime Player出现错误:无效的键形式。”
提前感谢任何帮助。
present
来全屏播放您的电影(而不是play
)。 - user1804762