【问题标题】:AppleScript instruction to set webcam in FaceTime在 FaceTime 中设置网络摄像头的 AppleScript 指令
【发布时间】:2015-08-26 00:55:19
【问题描述】:

我需要使用 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 的菜单栏项“视频”的菜单项“Webcam 520X”。

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

【问题讨论】:

    标签: applescript facetime


    【解决方案1】:

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

    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
    

    【讨论】:

      猜你喜欢
      • 2010-10-20
      • 1970-01-01
      • 1970-01-01
      • 2010-09-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多