Why can’t I set the mouse’s Tracking Speed slider in the Keyboard & Mouse:Mouse prefPane?
I keep getting the Sytem Events error, “NSReceiverEvaluationScriptError: 4” at “value” in the line, “set value to 1.”
tell application “System Preferences”
activate
set current pane to pane “com.apple.preference.keyboard”
end tell
tell application “System Events”
if UI elements enabled then
tell slider 1 of group 1 of tab group 2 of window 1 of process “System Preferences”
set value to 1 – (MY ERROR IN THIS LINE AT “value”)
end tell
else
tell application “System Preferences”
activate
set current pane to pane “com.apple.preference.universalaccess”
display dialog “UI element scripting is not enabled. Check "Enable access for assistive devices"”
end tell
end if
end tell
–
I based my script on the following OS X canned script, “Set Output volume.applescript,” which works fine. My problem above has got to be very simple.
tell application “System Preferences”
activate
set current pane to pane “com.apple.preference.sound”
end tell
tell application “System Events”
if UI elements enabled then
tell slider 1 of group 1 of window 1 of process “System Preferences”
if value is 0.5 then
set value to 0.8
else
set value to 0.5
end if
end tell
else
tell application “System Preferences”
activate
set current pane to pane “com.apple.preference.universalaccess”
display dialog “UI element scripting is not enabled. Check "Enable access for assistive devices"”
end tell
end if
end tell