Skip to content

Instantly share code, notes, and snippets.

@somerandomnerd
Last active October 13, 2022 15:37
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save somerandomnerd/f1986f104c1cc83160b3 to your computer and use it in GitHub Desktop.
Save somerandomnerd/f1986f104c1cc83160b3 to your computer and use it in GitHub Desktop.
Quickly Enable/Disable natural scrolling on OSX
tell application "System Preferences"
activate
set current pane to pane "com.apple.preference.trackpad"
end tell
tell application "System Events"
tell process "System Preferences"
click radio button "Scroll & Zoom" of tab group 1 of window "Trackpad"
set theCheckbox to checkbox 1 of tab group 1 of window "Trackpad"
tell theCheckbox
set checkBoxStatus to value of theCheckbox as boolean
if checkBoxStatus is false then click theCheckbox
# Set to "if checkBoxStatus is true" to disable
end tell
end tell
end tell
tell application "System Preferences"
quit
end tell
For some reason, Powerpoint for the Mac occasionally goes crazy and scrolls between slides erratically.
For some reason, disabling natural scrolling seems to stop this from happening.
This is an AppleScript (which I use Keyboard Maestro to trigger - you could probably do something with Automator and have a Service set up for it) to quickly enable/disable natural scrolling, so that Powerpoint doesn't drive me quite as crazy.
@elantanzer
Copy link

Thank you for posting your solution. It's the closest thing to a solution I've found yet. I'm having trouble with this, though, as the Trackpad preferences won't recognize my magic mouse as the track pad. It fails with an error about not finding a trackpad. Any suggestions?

@somerandomnerd
Copy link
Author

Sorry for the very late reply, but if you swap each instance of "trackpad" for "mouse", and swap "Scroll & Zoom" for "Point & Click" then I think it ought to do the job. (All this script does is open up System Preferences and unselects the relevant checkbox - there isn't any behind-the-scenes magic going on.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment