As everyone will know (who has Mac OS X Lion), by default, scrolling is inverted to make it a bit like the iPhone.

Problem: There is no way to have "normal scrolling" for a USB mouse, and "natural/inverted" scrolling for the trackpad. The setting (even though it is listed in both the mouse and trackpad settings) applies to both.

Question: Could someone, who is experienced with Automator or AppleScipting, please give me a few tips on how to make a shortcut that can toggle the inverted setting? I need this as when I'm at home, I have my Mac Book Air plugged to my Keyboard, Mouse and Monitor, and I'd like a quick way to change this setting

migrated from stackoverflow.com Aug 9 '11 at 18:40

This question came from our site for professional and enthusiast programmers.

  • Just curious, is opening Preferences not fast enough? – Evan Mulawski Aug 9 '11 at 17:59
  • I'm constantly docking and undocking my mac book, so a nice shortcut to change this would be nice. – jtnire Aug 9 '11 at 18:01
  • 3
    Why are people voting down this post? Is there something I have done wrong? – jtnire Aug 9 '11 at 18:06

This ought to do it:

tell application "System Preferences" to set the current pane to "com.apple.preference.mouse"
tell application "System Events"
    tell process "System Preferences"
        click radio button "Point & Click" of tab group 1 of window "Mouse"
        click the first checkbox
    end tell
end tell

Final Working Solution:

tell application "System Preferences"
    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"
        click checkbox 1 of tab group 1 of window "Trackpad"
    end tell
end tell

tell application "System Preferences"
end tell
  • This is what I have so far: pastebin.com/L0Tf7NSh It says it can't find checkbox 1 – jtnire Aug 9 '11 at 18:27
  • ...checkbox of group 1 try that. – fireshadow52 Aug 9 '11 at 18:32
  • "System Events got an error: Can’t get group 1 of process "System Preferences". Invalid index." – jtnire Aug 9 '11 at 18:34
  • Ok, this works: pastebin.com/JGUvA8U9 Any ideas on how I get the window to close? – jtnire Aug 9 '11 at 18:42
  • Ok: this is my final solution: pastebin.com/67PH15Ee – jtnire Aug 9 '11 at 18:49

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.