【发布时间】:2013-11-04 19:15:46
【问题描述】:
我正在尝试为我必须的项目编写一个小的 AppleScript:
- 开始录制 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。)
标签: timestamp applescript filenames quicktime autosave