Hello,
This is my first post on the MacRumors forum, and my first attempt with AppleScript.
I'd like to change the scrolling direction of my mouse wheel, with the help of an AppleScript. Since it isn't a MagicMouse, the checkbox in System Preferences is labeled "Scroll Direction: natural". I want to check or uncheck that checkbox with the AppleScript.
What I have now, is the following. I wrote this after checking several other posts on this forum, but I could not find exactly my problem.
I'd love to use it, but it gives the error that window \"Mouse"\ cannot be accessed.
Can anyone help me out?
Thank you.
Problem solved: the correct code is (thanks HexMonkey):
For other languages than English, the name of the checkbox and window after that, should be changed to as in System Preferences.
This is my first post on the MacRumors forum, and my first attempt with AppleScript.
I'd like to change the scrolling direction of my mouse wheel, with the help of an AppleScript. Since it isn't a MagicMouse, the checkbox in System Preferences is labeled "Scroll Direction: natural". I want to check or uncheck that checkbox with the AppleScript.
What I have now, is the following. I wrote this after checking several other posts on this forum, but I could not find exactly my problem.
Code:
tell application "System Preferences"
activate
set current pane to pane "com.apple.preference.mouse"
end tell
tell application "System Events"
tell application process "System Preferences"
tell tab group 1 of window "Mouse"
click checkbox "Scroll Direction: natural"
end tell
end tell
end tell
I'd love to use it, but it gives the error that window \"Mouse"\ cannot be accessed.
Can anyone help me out?
Thank you.
Problem solved: the correct code is (thanks HexMonkey):
Code:
tell application "System Preferences"
activate
set current pane to pane "com.apple.preference.mouse"
end tell
tell application "System Events"
tell application process "System Preferences"
click checkbox "Scroll direction: natural" of window "Mouse"
end tell
end tell
For other languages than English, the name of the checkbox and window after that, should be changed to as in System Preferences.
Last edited: