我正在尝试启动并隐藏quicktime播放器,开始录制我的iPhone屏幕一段时间并使用以下脚本将文件名“hello”保存在桌面上
(N + 1) * D
要隐藏我尝试过的快速播放器:
告诉应用程序“Finder” 将进程“QuickTime Player”的可见性设置为false 结束告诉
告诉应用程序“系统事件” 将frontProcess设置为最前面为true的第一个进程 将frontProcess的可见设置为false 结束告诉
以上3种方法不符合我的目的,我不希望这个快速时间在我的屏幕上或在我的DOCK中可见......
答案 0 :(得分:1)
将前窗的边界设置为“不可能”值并删除activate
行
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"
set newMovieRecording to new movie recording
set bounds of window 1 to {-3000, 0, 100, 100}
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
答案 1 :(得分:0)
tell application "System Events"
set visible of application process "QuickTime Player" to false
end tell