Question about keyboard shortcuts ..

Discussion in 'iMac' started by eroxx, Nov 27, 2012.

  1. macrumors 6502a

    Jul 27, 2010
    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!
  2. macrumors Nehalem


    Feb 19, 2005
  3. thread starter macrumors 6502a

    Jul 27, 2010
    Thanks! It's helpful, but not for contextual (right-click) menus ...
  4. macrumors Westmere


    May 16, 2008
    What, specifically, are you trying to make a keyboard shortcut for?
  5. thread starter macrumors 6502a

    Jul 27, 2010
  6. macrumors Core


    Jan 23, 2005
    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.

    tell application "System Events"
    	tell application process "Safari"
    		click menu item "Reset Safari…" of menu "Safari" of menu bar 1
    			click button "Reset" of window 1
    		end try
    	end tell
    end tell

Share This Page