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...

Mac OS X Hints
http://hints.macworld.com/article.php?story=20080229063434499