Applescript选中复选框为辅助功能设备启用Access

时间:2013-10-08 18:57:31

标签: user-interface applescript

我正在尝试自动选中将启用辅助功能设备访问权限的复选框。

enter image description here

下面是我打开正确设置窗口的代码。但是,它没有设置复选框。

tell application "System Preferences"
    activate
    set current pane to pane "com.apple.preference.universalaccess"
end tell

tell application "System Events"

    set theCheckbox to checkbox "Enable access for assistive devices"
    tell theCheckbox
        if not (its value as boolean) then click theCheckbox
    end tell

end tell

1 个答案:

答案 0 :(得分:1)

您只需将其设置为启用

即可
tell application "System Preferences"
    activate
    set current pane to pane "com.apple.preference.universalaccess"
end tell

tell application "System Events" to set UI elements enabled to true