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

eroxx

macrumors 6502a
Original poster
Jul 27, 2010
801
1
What can I use to create a keyboard shortcut that will allow me to create a hotkey for something found in a contextual menu (right-click) ? Thanks!
 

eroxx

macrumors 6502a
Original poster
Jul 27, 2010
801
1
Thanks! It's helpful, but not for contextual (right-click) menus ...
 

GGJstudios

macrumors Westmere
May 16, 2008
44,540
941
What can I use to create a keyboard shortcut that will allow me to create a hotkey for something found in a contextual menu (right-click) ? Thanks!
What, specifically, are you trying to make a keyboard shortcut for?
 

Weaselboy

Moderator
Staff member
Jan 23, 2005
34,071
15,493
California
What can I use to create a keyboard shortcut that will allow me to create a hotkey for something found in a contextual menu (right-click) ? Thanks!

I don't know of a way to directly access contextual menus, but for just about any contextual menu I can think of, that menu choice is just an alternative way to access a real menu choice in the app. For example in Safari I see Back/Reload Page/Open in Dashboard--Show page Source/Save Page As/Print Page when I right click. Every one of those commands can be accessed in the regular Safari menu.

So find the command you want in the app menus then make an Applescript to select that menu item. Then create a shortcut/hotkey to run the Applescript.

For example, here is an Applescript that will click the Reset Safari... menu choice. You can adapt this to any app and menu.


Code:
tell application "System Events"
	tell application process "Safari"
		click menu item "Reset Safari…" of menu "Safari" of menu bar 1
		try
			click button "Reset" of window 1
		end try
	end tell
end tell
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.