【发布时间】:2015-09-14 06:37:27
【问题描述】:
我正在尝试启动和隐藏 quicktime 播放器,开始录制我的 iPhone 屏幕一段时间,并使用以下脚本将输出保存在桌面上,文件名为“hello”
on run
set filePath to (path to desktop as text) & "hello.mov"
set f to a reference to file filePath
startVideoRecording(f)
end run
on startVideoRecording(f)
tell application "QuickTime Player"
activate
tell application "System Events"
keystroke "h" using command down
end tell
set newMovieRecording to new movie recording
set camera to "Prabhu Konchada's iPhone"
tell newMovieRecording
set camera to "Prabhu Konchada's iPhone"
start
end tell
delay (10)
pause
save newMovieRecording in f
stop
close newMovieRecording
end tell
end startVideoRecording
为了隐藏我试过的快速播放器:
- 告诉应用程序“系统事件”告诉进程“QuickTime Player”使用向下命令击键“h”。
告诉应用程序“Finder” 将进程“QuickTime Player”的可见设置为 false 结束告诉
告诉应用程序“系统事件” 将 frontProcess 设置为最前面为 true 的第一个进程 将 frontProcess 的可见设置为 false 结束告诉
以上 3 种方法没有达到我的目的,我不希望这个快速时间在我的屏幕上或在我的 DOCK 中可见......
【问题讨论】:
标签: applescript