To create the Automator Service:
- Open Automator
- Choose New Document
- Choose Quick Action
- Type in the Search Box: Run AppleScript
- Double Click on Run AppleScript in the results box
- Replace all the contents of the text box with:
AppleScript:
on run {input, parameters}
tell application "System Preferences"
activate
end tell
tell application "System Events"
tell process "System Preferences"
delay 1
click the menu item "Trackpad" of the menu "View" of menu bar 1
delay 1
click the radio button "Scroll & Zoom" of the first tab group of window "Trackpad"
click checkbox 1 of tab group 1 of window "Trackpad"
end tell
end tell
return input
end run
- File->Save ⌘S
- Name it: Toggle Scroll Direction
- Once it is saved, you can find the command in the Service menu found in the Application menu of every app.
You might have to allow accessibility in the Security and Privacy settings Privacy tab after clicking the lock to make changes.
Edit: Not sure if you can move services files around since they are executable. But you can try to unzip this and put it in ~/Library/Services if you want to try to skip the above steps. Double clicking on the unzipped icon seems to work too.
Edit: I don't think this approach works any longer. I'm getting an error that says "Run AppleScript not authorized to send Apple Events to System Events." Apple might have broken something in one of the latest Big Sur releases. I have an alternate version that works (as far as I can tell.) I'll post it tomorrow.