X

Tackling problems with custom shortcut assignments in OS X

In OS X you can conveniently create your own custom keyboard hot keys for menu commands; however, sometimes they may not work properly.

Topher Kessler MacFixIt Editor
Topher, an avid Mac user for the past 15 years, has been a contributing author to MacFixIt since the spring of 2008. One of his passions is troubleshooting Mac problems and making the best use of Macs and Apple hardware at home and in the workplace.
Topher Kessler
4 min read

The system menu in OS X holds the various commands that are available for performing tasks in your current application.

For many of the commands that are commonly used, Apple and application developers have bound them to keyboard shortcuts (listed next to the menu item) so you can perform the same command with a keystroke instead of needing to access the menus.

When browsing through the various system or application menus, you will see that in addition to the commands with built-in keyboard shortcuts there are a number without shortcuts. These are generally less-common commands; however, there are some that a few people might access quite often. For instance, Apple's Preview application is quite useful for performing simple cropping and resizing edits of pictures; however, while cropping has Command-K as its hot key, the resize option does not have one and needs to be accessed via the menu.

To overcome this limitation, you can assign your own hot keys to these commands using the Keyboard system preferences. In the Keyboard preferences, go to the Keyboard Shortcuts tab and select the Application Shortcuts option. Then click the Plus button to create a new custom shortcut for an application's menu item that you specify.

TextEdit Window menu showing hotkeys
Usually these options in TextEdit's "Window" menu do not have shortcuts and only the first command is shown, but when assigned to a shortcut then both will be shown in the menu. Screenshot by Topher Kessler

One tip to keep in mind when creating shortcuts is that often there are alternate menu items available that are only revealed by holding a modifier key such as Option or Shift. For instance, in TextEdit if you go to the Window menu you will see an option to "Bring to front," which will bring all the TextEdit windows above those of other applications. However, if you hold the Option key with the menu open then this command changes to "Arrange in front," which will organize the windows for you. Neither of these options has a built-in hot-key shortcut, but you can assign a custom one to either of the command options by entering the command name. After creating a shortcut for the command, the shortcut will show up next to it in the menu, but if you create a shortcut for the hidden command, then it should display underneath the initial one.

While this feature is convenient, there may be instances where your shortcut does not work, and instead of performing the desired function the system will output an error sound when the hot key is pressed. If you run into these errors with your hot keys, there are some steps you can take to correct the issue:

  1. Check for duplicates
    If the shortcut you have assigned is a duplicate of another function, or if the command you have assigned it to is duplicated elsewhere, then you may run into an error. While OS X should show a warning triangle next to any duplicate hot-key sequences when you are entering them, there may be instances where these warnings don't happen or the system still allows you to save the setting. This may especially be true if the shortcut can be set in another area of the system, such as the keyboard assignments for switching desktops in the Mission Control system preferences.

    Luckily all keyboard shortcuts should be listed in the "Keyboard Shortcuts" system preferences, regardless of where else they may be configured on the system. Therefore, you can browse through the various categories in the Keyboard Shortcuts system preferences to review the active shortcuts.

  2. Entering new keyboard shortcuts
    When entering new shortcuts, in addition to ensuring the command is spelled, punctuated, and capitalized exactly as it appears in the menu, you might need to assign it to "All Applications" to get it to work. Screenshot by Topher Kessler
  3. Check spelling
    In order for the shortcuts to work, the command you enter in the configuration needs to be exactly as it appears in the system menus. Not only does this mean that capitalization has to match, but any additional characters must be correct as well. Often Apple and application developers will place three dots after a command name, which in some instances might be three sequential periods, but also might be an ellipsis which is a single character of three dots. Therefore if you have tried entering a command name that contains three periods and it appears to be spelled correctly, try replacing the dots with the ellipsis character, which can be accessed by pressing the semicolon character with the Option key held down (alternatively you can use the OS X keyboard and character viewers to access custom symbols).

  4. Assign to 'All applications'
    In more-recent versions of OS X such as Lion, Apple has increased its sandboxing of applications, which is a method of isolating an application from others to enhance the security and stability of the system. While for now sandboxing of an application is voluntarily done by the developer, Apple is requiring it to be done for all applications distributed through the Mac App Store. Sandboxing has its benefits, but bugs in the rules for the sandbox may impede on some applications' capabilities to accept inputs, including custom shortcut assignments. For instance, it appears that even if spelled correctly, the sandboxed application Preview will not accept keyboard shortcuts for some of its functions such as the option for adjusting image sizes, and users who have done so will find that the program gives an error sound regardless of the hot key and spellings that are used.

    In these instances where no configuration seems to work, you might be able to get success by assigning the hot key to "All applications" instead of to the specific application. In most cases specific functions are already very application specific, so it is rare that the same spelling will appear in a menu for more than one application, or that you would intend on using the same hot key if the function's name is the same as another application.


Questions? Comments? Have a fix? Post them below or e-mail us!
Be sure to check us out on Twitter and the CNET Mac forums.