System preferences with AppleScript

Joined
Oct 10, 2011
Messages
1
Reaction score
0
Points
1
Hi,

I'm trying to enable mouse keys with Applescript.

Here's what I have so far:


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

tell application "System Events"
*tell process "System Preferences"
**tell tab group "Mouse" of window "Universal Access"
** tell radio group "Mouse Keys:"
** *if radio button "Off" is boolean then
** * click radio button "On"
** *end if
** end tell
**end tell
*end tell
end tell

tell application "System Preferences"
*quit
end tell


I keep getting the error "Can't get tab group "Mouse" of window "Universal Access" of process "System Preferences".

What did I di wrong?

I'm sorry but I'm new to AppleScript
 

chscag

Well-known member
Staff member
Admin
Joined
Jan 23, 2008
Messages
65,248
Reaction score
1,833
Points
113
Location
Keller, Texas
Your Mac's Specs
2017 27" iMac, 10.5" iPad Pro, iPhone 8, iPhone 11, iPhone 12 Mini, Numerous iPods, Monterey
Moved here. Does not belong in "Running Windows........."
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top