Automator(ing) the Secondary right click after resset?

Discussion in 'macOS' started by n8236, Jun 18, 2006.

  1. n8236 macrumors 65816

    Joined:
    Mar 1, 2006
    #1
    Does anyone know how to create an automation to uncheck then recheck the "tap to right click" option under Preference ~> Trackpad option? The 2ndary click works great if I don't restart OSx much, but I do it often enough that it gets annoying to manually re-activiate that option since it doesn't load up on restarts.

    Thanks :)
     
  2. mduser63 macrumors 68040

    mduser63

    Joined:
    Nov 9, 2004
    Location:
    Salt Lake City, UT
    #2
    It's possible with GUI scripting in AppleScript. Don't have time right now, but I'll try to remember to put a script together and post it later today.
     
  3. mduser63 macrumors 68040

    mduser63

    Joined:
    Nov 9, 2004
    Location:
    Salt Lake City, UT
    #3
    Oh, I didn't realize you were asking about a MacBook/MacBook Pro only option. I'd need one of those to figure the script out correctly. However, I'll post a starting point. This script sets the "Ignore accidental trackpad input" option in the Trackpad tab of Keyboard & Mouse Preferences. Hopefully someone else will come along who has a MB or MBP and modify it to do what you want. The modification is very small, you just have to use UI Element Inspector to figure out which checkbox is "tap to right click" and change the AppleScript to check that instead. It may be as simple as replacing "Ignore accidental trackpad input" in the script with the (exact) name of the checkbox you're concerned with. To use this script, open Script Editor and paste it in, then save it as an application where ever you'd like. To make it work, you'll have to check "Enable GUI Scripting" in AppleScript Utility in your Utilities folder. Hope this helps.

    Code:
    --Open and activate System Preferences
    tell application "System Preferences" to activate
    
    --Attempt to change settings using System Events
    tell application "System Events"
    	tell process "System Preferences"
    		try
    			--Open the "Keyboard & Mouse" pane
    			click menu item "Keyboard & Mouse" of menu "View" of menu bar 1
    			
    			--Now set the option. The delays prevent actions being sent before previous ones have been completed
    			delay 2
    			tell tab group of window "Keyboard & Mouse"
    				click radio button "Trackpad"
    				delay 2
    			end tell
    			if (the value of checkbox "Ignore accidental trackpad input" of group 1 of tab group 1 of window "Keyboard & Mouse") is 0 then
    				click checkbox "Ignore accidental trackpad input" of group 1 of tab group 1 of window "Keyboard & Mouse"
    			end if
    			
    		on error theError
    			--An error occured
    			display dialog ("Sorry, an error occured while altering Keyboard and Mouse settings:" & return & theError) buttons "OK" default button "OK"
    		end try
    	end tell
    end tell
    delay 1
    tell application "System Preferences" to quit
     
  4. n8236 thread starter macrumors 65816

    Joined:
    Mar 1, 2006
    #4
    Awesome work man, i'll give this a shot! I guess i wouldn't have that problem once I start using Parallells instead of Bootcamp :)
     

Share This Page