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

Assign one keyboard shortcut to multiple menu items System
You may have read the title to this hint and thought "Huh? How can that possibly work? How does the system know which command to run when you type the shortcut? And why would you want to do this?" A bit more explanation is required to see the benefit of this hint: it's for use with menu items whose names change after they've been selected.

In this case, I wanted an easier way to toggle the display of smileys off and on in iChat (because iChat replaces =$ with a "dollar sign smiley face," meaning that pasted code often looks quite odd). Disabling smileys is done with View » Messages » Hide Smileys. Easy enough to assign that to Control-S, for example, in the Keyboard Shortcuts tab of the Keyboard & Mouse System Preferences panel. But once you've hidden smileys, that menu item becomes Show Smileys, and the keyboard shortcut vanishes. On a lark, I tried assigning Show Smileys the same Control-S shortcut...
I was fully expecting OS X to tell me that I couldn't assign Control-S again, as it had already been assigned to another function in iChat. But no such error message appeared, as you can see in the image above. This works perfectly -- Control-S toggles smileys both off and then back on again.

This should work in any application that has menu items whose names change based on the status of the feature they control. However, I've only tested it in iChat -- and only on 10.5, so I'm not sure if this works in 10.4, too.
    •    
  • Currently 1.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (5 votes cast)
 
[10,347 views]  

Assign one keyboard shortcut to multiple menu items | 5 comments | Create New Account
Click here to return to the 'Assign one keyboard shortcut to multiple menu items' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Assign one keyboard shortcut to multiple menu items
Authored by: mistersquid on Feb 29, '08 08:47:46AM

I'm not sure if this works in 10.4, too

It does.



[ Reply to This | # ]
Assign one keyboard shortcut to multiple menu items
Authored by: Mike Perry on Feb 29, '08 08:53:58AM

Ah, but you've also brought up the topic of 'toggling' menu items. Programmers seem to like them since they display a bit of cleverness and variety. I hate them because I never know what to look for. Having a check mark come and go is a better approach.

InDesign is the worst in this regard. Check out the View menu and its submenus and you'll find that, for no apparent rhyme or reason, some items change from Show to Hide while others doing something very similar have check marks appearing and disappearing. Confusing.

If the menu text didn't change, it'd be more obvious that we could use the same keyboard command to turn a feature on or off.

--Michael W. Perry, editor of Across Asia on a Bicycle



[ Reply to This | # ]
Assign one keyboard shortcut to multiple menu items
Authored by: asmeurer on Mar 03, '08 05:00:05PM

Yeah, I have Command-P set to an AppleScript that shows Party Shuffle (See doug's AppleScripts website) even though Command-P is print playlist. On very rare occasions, iTunes decides to open a print dialog box, but 99% of the time the Party Shuffle overrides it.

I think there is some kind of hierarchy for determining which menu item with the same keyboard shortcut gets the command. A little testing anyone?



[ Reply to This | # ]
Assign one keyboard shortcut to multiple menu items
Authored by: PhilippeBonneau on Mar 13, '08 08:43:36AM

Is there a way to do that with a menu item displayed in many languages depending on the localisation of the software. My system is in french and in many software I read «Imprimer en format PDF...» and in others I read «Print as PDF...». I try to assign the same shortcut to both but it is not working.



[ Reply to This | # ]
Assign one keyboard shortcut to multiple menu items
Authored by: PhilippeBonneau on Mar 13, '08 09:10:10AM

In a reply to my self because I did not find a way to edit my first post:

I made a mistake in typing the menu name in English. The hint works perfectly in a multi language environment. That's particularly useful when we are forced to use badly localized software.

Thanks!

Art Vie Design!

Philippe



[ Reply to This | # ]