我正在尝试制作一个通过对 photoBooth 进行屏幕截图来拍照的 AppleScript。但是,我无法将窗口设置为一。这是我的代码:
tell application "Photo Booth"
activate
set volume output volume 0
tell application "Finder" to set visible of process "Photo Booth" to false
set windowid to id of window 1 of application "Photo Booth"
do shell script "screencapture -l" & windowid & " ~/test.png"
tell application "Photo Booth"
end tell
delay 0
quit
结束告诉
tell application "Photo Booth" to activate
delay 2
tell application "System Events"
keystroke return using {command down}
delay 5
end tell
tell application "Photo Booth" to quit