2021年5月1日星期六

Using Applescript to change System Preferences

So I found this question and this mostly solves my problem, but I want to do more than just a checkbox, for my option, which is to enable mouse keys, you need to also navigate submenus and stuff. I've come so far:

tell application "System Preferences"       activate       delay 2       set the current pane to pane id "com.apple.preference.universalaccess"       delay 2       #More Code here to select submenu "Pointer Controls", "Alternative Control Methods" and click the checkbox "Enable Mouse Keys"  end tell  

If you're asking why I didn't just enable the option to enable mouse keys with 5 clicks of the option button with

 tell application "System Events"        repeat 5             key code 58 #key code for the option key             delay 0.05        end repeat   end tell  

I tried that, it just wouldn't work.

https://stackoverflow.com/questions/67351084/using-applescript-to-change-system-preferences May 02, 2021 at 05:41AM

没有评论:

发表评论