Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

natatos

macrumors regular
Original poster
Dec 23, 2008
137
0
Iowa
I'm working on a applescript that when I run will change the scrolling direction in trackpad. Its for when I'm using my mouse I don't want to get used to going the other way than other computers I use. Heres the code
Code:
tell application "System Preferences"
    set current pane to pane "Trackpad"
        tell application "System Events"
            tell window "Trackpad" of process "System Preferences"
                click checkbox "Scroll direction: natural"
            end tell
        end tell
    end tell
	
tell application "System Preferences"
    quit
end tell

Its at the line
Code:
tell window "Trackpad" of process "System Preferences"
    click checkbox "Scroll direction: natural"
that I get messed up. I was able to make the selection in the mouse pane work but I would rather it be the trackpad one. How can I make it so the script goes to the tab scroll & zoom and what do I put for the checkbox name? Thanks for the help
 

r0k

macrumors 68040
Mar 3, 2008
3,611
75
Detroit
I'm working on a applescript that when I run will change the scrolling direction in trackpad. Its for when I'm using my mouse I don't want to get used to going the other way than other computers I use. Heres the code
Code:
tell application "System Preferences"
    set current pane to pane "Trackpad"
        tell application "System Events"
            tell window "Trackpad" of process "System Preferences"
                click checkbox "Scroll direction: natural"
            end tell
        end tell
    end tell
	
tell application "System Preferences"
    quit
end tell

Its at the line
Code:
tell window "Trackpad" of process "System Preferences"
    click checkbox "Scroll direction: natural"
that I get messed up. I was able to make the selection in the mouse pane work but I would rather it be the trackpad one. How can I make it so the script goes to the tab scroll & zoom and what do I put for the checkbox name? Thanks for the help

You can't get to the trackpad pane unless you have a multitouch gesture capable trackpad active on your Mac. I (via google) found a recipe for doing it in terminal that requires you to log out and back in for it to take effect...

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

Of course anything you can do in terminal you can do in applescript using do shell script. Hopefully this gets you started in the right direction to find your answer.
 

T1m

macrumors newbie
Dec 3, 2011
1
0
This is my first ever forum post so hope it makes since and helps someone.

Is this the answer / script you are looking for to reverse the Scroll Direction easily:

Code:
tell application "System Preferences"
	activate
	set current pane to pane "com.apple.preference.trackpad"
end tell

tell application "System Events"
	tell application process "System Preferences"
		tell tab group 1 of window "Trackpad"
			click radio button "Scroll & Zoom"
			click checkbox 1
		end tell
	end tell
end tell

tell application "System Preferences"
	quit
end tell

Happy Scripting!!
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.