Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Turn trackpad clicking on and off via AppleScript System
I am not a coder by any means, but I couldn't find an AppleScript to turn on and off trackpad clicking. On my ibook, I usually have trackpad clicking on, but when I'm doing alot of typing I like to turn it off. So I wrote this very brute force UI script to do just that. Feel free to offer improvements (such as more elegance and perhaps running in the background).
tell application "System Preferences"
  activate
  set current pane to pane "com.apple.preference.keyboard"
  tell application "System Events"
    keystroke tab
    keystroke (ASCII character 29)
    keystroke space
    keystroke tab
    keystroke tab
    keystroke tab
    keystroke space
  end tell
  quit
end tell
[robg adds: To make it easy to use this script, you could save it in your user's Library: Scripts folder, and then access it through the Scripts icon in the menubar...]
    •    
  • Currently 3.33 / 5
  You rated: 5 / 5 (3 votes cast)
 
[7,049 views]  

Turn trackpad clicking on and off via AppleScript | 8 comments | Create New Account
Click here to return to the 'Turn trackpad clicking on and off via AppleScript' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Turn trackpad clicking on and off via AppleScript
Authored by: pegstar on Mar 04, '05 11:31:16AM

How is this different than opening "system preferences", choosing "trackpad" and unchecking the "clicking" box?



[ Reply to This | # ]
Turn trackpad clicking on and off via AppleScript
Authored by: KingDoom on Mar 04, '05 11:40:55AM

Its much quicker than repeatedly pointing and clicking. You can assign a keyboard shortcut to it and it is carried out in one step.

Very helpful if you need to change the trackpad settings frequently.



[ Reply to This | # ]
Turn trackpad clicking on and off via AppleScript
Authored by: Gigacorpse on Mar 04, '05 12:08:16PM

Because it is automated.



[ Reply to This | # ]
Turn trackpad clicking on and off via AppleScript
Authored by: bedoughty on Mar 04, '05 03:31:12PM

anyone seen a script like this to toggle the F key functionality on an ibook/powerbook? As in: that option in Keyboard and Mouse Preferences where the F keys are either actual F keys or they serve the functions Apple assigned, like volume, brightness, etc?

---
this isn't who it would be
if it wasn't who it is
T.Anastasio



[ Reply to This | # ]
Function Keys
Authored by: mike508 on Mar 04, '05 05:38:23PM

Try uControl <http://gnufoo.org/ucontrol/ucontrol.html>



[ Reply to This | # ]
Turn trackpad clicking on and off via AppleScript
Authored by: saigontiger on Mar 04, '05 09:48:05PM

hi, i tried this, but can't get it to turn off clicking. i copied all and it still double clicks after running the script. pls. advise what i could be doing wrong...
thanks
ST



[ Reply to This | # ]
Turn trackpad clicking on and off via AppleScript
Authored by: DeltaTee on Mar 07, '05 10:23:26AM

I believe that you need to have full keyboard access enabled for the script to work.

If the script still does not work, what does the script do when you run it?



[ Reply to This | # ]
Turn trackpad clicking on and off via AppleScript
Authored by: fogboy on May 16, '06 03:32:09PM

i posted the below as a hint, and it didn't go, and i realized it must be because the issue was dealt with previously. indeed. here's my slightly shorter solution.


Occasionally, I let other people (my partner, co-workers) hop on my PowerBook to look something up or write a quick email etc. My practice of keeping the trackpad on clicking mode can be annoying and confusing to those who don't use it, or who don't even know it's possible, as they inadvertentlly click on something they didn't mean to. Yet for me, drilling down into the Keyboard & Mouse preference pane and unchecking the "Clicking" box was more time consuming and than I'd like. This applescript was for me an elegant solution, hope others may fine it useful. (It's especially useful with Quicksilver, since i can just invoke, hit t-o-g-Return (which finds the script i've named "Toggle Trackpad Clicking") and it's done)

Important: for the script to work you must have "Enable access for assistive devices" checked in the Universal Access prefernece pane. Also, your mileage may vary and it's possible the delay written in to the script will need to be longer or shorter.


how to use:

  • copy the text below
  • paste into Script Editor
  • save to a convenient place, choosing "Application" from the File Format pull-down menu in the Save dialog.
  • Enjoy!

tell application "System Preferences"
	activate
end tell
tell application "System Events"
	tell process "System Preferences"
		click the menu item "Keyboard & Mouse" of the menu "View" of menu bar 1
		delay 4
		click the radio button "Trackpad" of the first tab group of window "Keyboard & Mouse"
		click the checkbox "Clicking" of the first group of the first tab group of the window "Keyboard & Mouse"
	end tell
end tell
tell application "System Preferences"
	quit
end tell


[ Reply to This | # ]