5

In Addressbook I want to create a keyboard shortcut for the Menu entry Delete Group using the key combination option-command-delete.

So I went to System Preferences --> Keyboard --> Keyboard Shortcuts and added an app-specific shortcut entry for "Delete Group". But when I tried to assign the key combination option-command-delete, my input wouldn't get accepted. (Combinations with letter like option-command-D work, though.)

How can I enter a shortcut combination involving the delete key?

2 Answers 2

2

You can edit the property list that stores the shortcuts directly. For example open ~/Library/Preferences/com.apple.AddressBook.plist with TextMate or TextWrangler, and add:

<key>NSUserKeyEquivalents</key>
<dict>
    <key>Delete Card</key>
    <string>~@&#x0008;</string>
</dict>

The shortcut strings are documented in http://www.hcs.harvard.edu/~jrus/Site/Cocoa%20Text%20System.html.

2
  • This is excellent! Thanks! I've tried it and it works brilliantly. Only things to add: (1) The code snippet has to go inside the most-outer <dict>...</dict> tag pair and (2) the text editor has to convert the binary plist file first into text format before you can edit it.
    – halloleo
    Apr 2, 2012 at 9:33
  • @halloleo I believe that if you use Xcode to edit the plist, you don't have to worry about converting between binary and text formats. If you don't have Xcode, you can use defaults write $path_to_plist NSUserKeyEquivalents -dict-add "$command_name" "$shortcut_string". Nov 14, 2012 at 6:46
0

Note to self: The answer by Lri works, but the shortcut strings mentioned on the linked Harvard page do not work if you just enter the text in NSUserKeyEquivalents yourself. To get them to work, they have to be entered in the same format that Lri used (&#x0008;), which is apparently "hexadecimal numeric character reference" (or "hex NCR"), as referenced in the conversion table on this page:

http://www.endmemo.com/unicode/ascii.php

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .