Applescript 如何单击系统首选项中下拉选项卡的复选框

Applescript 如何单击系统首选项中下拉选项卡的复选框,applescript,Applescript,我正在尝试制作一个AppleScript来更改系统首选项中的一个选项。通过单击“辅助功能”窗格的“鼠标和触摸板”菜单中的“鼠标选项…”可显示该复选框。到目前为止,我编写的脚本能够在系统首选项中导航,以便单击所需的复选框。但是,我找不到单击复选框的方法,似乎是因为复选框位于窗口上的某种“下拉选项卡”中。我在网上找到的所有教程都没有涉及这个特定问题 到目前为止我的代码- tell application "System Preferences" activate set the current

我正在尝试制作一个AppleScript来更改系统首选项中的一个选项。通过单击“辅助功能”窗格的“鼠标和触摸板”菜单中的“鼠标选项…”可显示该复选框。到目前为止,我编写的脚本能够在系统首选项中导航,以便单击所需的复选框。但是,我找不到单击复选框的方法,似乎是因为复选框位于窗口上的某种“下拉选项卡”中。我在网上找到的所有教程都没有涉及这个特定问题

到目前为止我的代码-

tell application "System Preferences"
 activate
 set the current pane to pane id "com.apple.preference.universalaccess"
 get the name of every anchor of pane id "com.apple.preference.universalaccess"
 reveal anchor "Mouse" of pane id "com.apple.preference.universalaccess"
 tell application "System Events" to tell process "System Preferences"
    click button 5 of window "Accessibility"
 end tell
end tell
所需的复选框为“滚动”。我希望下面的代码可以工作,但它没有工作-它单击后台的复选框,而不是选项卡中的复选框

tell application "System Events" to tell process "System Preferences"
    click checkbox 1 of window "Accessibility"
 end tell

应该说,这是我第一次使用AppleScript。任何帮助都将不胜感激。

下拉选项卡称为工作表:

tell application "System Preferences"
 activate
 set the current pane to pane id "com.apple.preference.universalaccess"
 reveal anchor "Mouse" of pane id "com.apple.preference.universalaccess"
  tell application "System Events" to tell process "System Preferences"
   click button 5 of window 1
   click checkbox 1 of sheet 1 of window 1
  end tell
end tell