0

我需要使用 AppleScript 自动进行 FaceTime 通话,但我的要求之一是选择特定的网络摄像头。我正在尝试使用此代码:

tell application "System Events"
tell process "FaceTime"
    tell menu bar 1
        tell menu bar item "Video"
             click menu item "Webcam 520X"
        end tell
    end tell
end tell
end tell

但我收到了这个错误信息:

系统事件出现错误:无法获取进程“FaceTime”的菜单栏 1 的菜单栏项“视频”的菜单项“网络摄像头 520X”。

关于如何以正确的方式做到这一点的任何建议?谢谢!

4

1 回答 1

0

和它之间总是有一个menu引用menu itemmenu bar item

activate application "FaceTime"
tell application "System Events"
    tell process "FaceTime"
        tell menu bar 1
            tell menu bar item "Video"
                tell menu 1
                    click menu item "Webcam 520X"
                end tell
            end tell
        end tell
    end tell
end tell

或者

activate application "FaceTime"
tell application "System Events"
    tell process "FaceTime"
        click menu item "Webcam 520X" of menu 1 of menu bar item "Video" of menu bar 1
    end tell
end tell
于 2015-08-25T16:55:19.290 回答