Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > macOS > AppleScript to enable/disable right click option?

AppleScript to enable/disable right click option?
Thread Tools
Daracle
Grizzled Veteran
Join Date: Nov 2003
Location: Calgary, Alberta
Status: Offline
Reply With Quote
Jan 18, 2009, 12:34 AM
 
Hope this is in the right forum.
I sometimes find myself working from home and using a remote desktop to my Windows machine back in my office, where I am often using my right mouse button.
Hating the right click option on my Mighty Mouse, I was wondering if there is something available with the Automator or AppleScript (I don't know either very well) to set this to a keystroke or something as easy? I have tried to use Automator to simply record myself doing it but it didn't work out too well and I think I have to sit there and watch it do it each time.

In a perfect world, I would love to be able to switch the option on and off as often as I would change which window I am looking at.

Thanks, as always, for the assistance MacNNers.
Who reads this???
     
turtle777
Clinically Insane
Join Date: Jun 2001
Location: planning a comeback !
Status: Offline
Reply With Quote
Jan 18, 2009, 02:28 AM
 
I'm not sure if I follow.

On WHICH computer (Mac or PC) do you want to replace the right click with a keyboard shortcut ?

If it's on the Mac, you can disable right click in the System Preferences, and the use Control + left click instead.

-t
     
Daracle  (op)
Grizzled Veteran
Join Date: Nov 2003
Location: Calgary, Alberta
Status: Offline
Reply With Quote
Jan 18, 2009, 12:56 PM
 
Thanks for the reply.

I would like to have the secondary mouse turned off for when I am in my OS X environment and would like to easily enable it when I am in the Windows environment.
Who reads this???
     
turtle777
Clinically Insane
Join Date: Jun 2001
Location: planning a comeback !
Status: Offline
Reply With Quote
Jan 18, 2009, 02:56 PM
 
Well, then what I wrote should do what you need.

-t
     
Daracle  (op)
Grizzled Veteran
Join Date: Nov 2003
Location: Calgary, Alberta
Status: Offline
Reply With Quote
Jan 19, 2009, 08:36 PM
 
Thanks, but I find that does not work properly with some things in Outlook that I use and some of the things I do in some of my apps for SQL and such.
Who reads this???
     
CharlesS
Posting Junkie
Join Date: Dec 2000
Status: Offline
Reply With Quote
Jan 19, 2009, 09:10 PM
 
Does USB Overdrive work with the Mighty Mouse? If it does, you could set up a setting for Remote Desktop that linked the right "button" to Right Click as usual, and then set the right "button" to a regular Mouse Click in the global settings.

Ticking sound coming from a .pkg package? Don't let the .bom go off! Inspect it first with Pacifist. Macworld - five mice!
     
Sal
Dedicated MacNNer
Join Date: Sep 2000
Location: Cupertino, CA USA
Status: Offline
Reply With Quote
Jan 19, 2009, 11:22 PM
 
You can write an AppleScript script to enable/disable the right mouse click. Explanations about scripting the System Preferences using UI Scripting are on this page <http://www.apple.com/applescript/uiscripting/index.html> along with an installer for sample script examples.

Here's the script for turing off the right click:

Code:
tell application "System Preferences" activate set the current pane to pane id "com.apple.preference.keyboard" reveal anchor "mouseTab" of the current pane end tell tell application "System Events" tell process "System Preferences" click pop up button 3 of tab group 1 of window 1 click menu item "Primary Button" of menu 1 of pop up button 3 of tab group 1 of window 1 delay 1 keystroke "q" using command down end tell end tell
     
   
Thread Tools
 
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 08:31 AM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,