1

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

在此处输入图像描述

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

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
4

1 回答 1

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
于 2013-10-08T19:14:53.600 回答