我有这个简单的代码:
tell application "QuickTime Player"
activate
new screen recording
document "Screen Recording" start
delay 10
document "Screen Recording" stop
end tell
这在我的 10.8 机器上录制了 10 秒的电影,没有问题。
但是在 10.9 mac-mini 上,QT 卡在上面的停止操作处。
它卡在窗口上,并带有“正在完成录制”的消息。
我必须强制退出它,但仍然是同样的事情。如果我手动执行这些步骤,它们会起作用。但是使用 AppleScript 甚至使用 Automator 的相同步骤都有相同的问题。
我升级到 10.9.2,但仍然是同样的问题。
这是一个已知的错误?任何解决方法的建议?
谢谢。
最佳答案
我做这样的事情来记录 CI 的屏幕,它总是对我有用:
set filePath to (path to desktop as string) & "ScreenRecordingFile.mov"
tell application "System Events" to tell process "Simulator"
set frontmost to true
end tell
tell application "QuickTime Player"
activate
set newScreenRecording to new screen recording
delay 1
tell application "System Events"
tell process "QuickTime Player"
set frontmost to true
key code 49
end tell
end tell
tell newScreenRecording
start
delay 15
stop
end tell
export document 1 in (file filePath) using settings preset "720p"
close document 1 saving no
end tell
关于macos - 使用 Applescript 录制的 Quicktime Player 在 Mavericks 上被破坏了?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22676109/