我正在尝试启动并隐藏 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
Run Code Online (Sandbox Code Playgroud)
为了隐藏 Quicktime 播放器,我尝试过:
告诉应用程序“Finder”将进程“QuickTime Player”的可见设置为 false 结束告诉
告诉应用程序“系统事件” 将 frontProcess 设置为第一个最前面为 true 的进程 将 frontProcess 的可见设置为 false end Tell
上述 3 种方法没有达到我的目的,我不希望这个 Quicktime 遍布我的屏幕或在我的 DOCK 中可见......
tell application "System Events"
set visible of application process "QuickTime Player" to false
end tell
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
7512 次 |
| 最近记录: |