Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I'm looking to make a script that quickly toggles the Natural scrolling settings, so I need a way to do it from the command line.

I think I found the correct defaults command, but I'm not sure how to apply it without logging out. Here is the command I'm using:

defaults write ~/Library/Preferences/.GlobalPreferences com.apple.swipescrolldirection -bool

share|improve this question
add comment

1 Answer 1

I don't know if this works on Lion or with a Magic Mouse, but it also changes the setting for trackpads on my account.

osascript -e 'tell application "System Preferences"
    reveal anchor "mouseTab" of pane id "com.apple.preference.mouse"
end tell
tell application "System Events" to tell process "System Preferences"
    click checkbox 1 of window 1
end tell
quit application "System Preferences"'
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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