capsule review

Contextual menu shortcuts?

As longtime Mac Gems readers have likely deduced, I love keyboard shortcuts. If I can access a function more quickly or more easily, I’m all for it. I’m also a big fan of contextual menu plugins—being able to add useful features to Mac OS X’s ubiquitous “right-click” menus is a boon to my productivity. But until now, I haven’t been able to combine the two features. That is, I haven’t been able to assign keyboard shortcuts to my contextual menu items.

Now, it’s quite possible that I’ve just lost half the readers of today’s column, who are shaking their heads thinking, “OK, you’ve just gone one step too far in the pursuit of efficiency.” But for those still with me, the latest Mac Gems discovery will be a neat addition to your system-tweaking toolbox. Abracode’s free Shortcuts 1.0 (   ) lets you perform just such contextual-menu magic.

After launching Shortcuts, its Assign Hot Keys screen presents you with a list of current contextual menu items, divided into the type of action each performs: actions on text (Spotlight searches, third-part text-munging tools), on files (Automator actions, third-party file manipulation tasks), or on folders (similar to files). To assign a keyboard shortcut to a contextual menu action, you simply choose it from the pop-up menu; a dialog will appear asking you to press the desired shortcut. (An item displayed in red in one of the pop-up menus means you’ve already assigned a shortcut to that item.)

Shortcuts main window

Shortcuts keyboard shortcut dialog

In the above example, I’ve assigned Shift+Command+/ (basically, Command+?) to Mac OS X’s “Spotlight” contextual menu item. Now, whenever I have text highlighted, I can press Command+? to immediately open a Spotlight window with a search for that text already initiated. I’ve also assigned Control+Option+Command+C to the third-party CalculateSizeCM, which calculates the number of files and folders in, and the total size of, a folder, along with the exact breakdown of data-fork and resource-fork sizes—basically a more informative version of the Finder’s Get Info window.

(Note that, like contextual menus themselves, Shortcuts’ options are also contextual, and are based on the the Example files on the Assign Hot Keys screen. For example, by default, the File example file is a PNG image; the contextual menu options available from File pop-up menu are thus actions available for image files. If you use the Choose Other File button to choose a different type of file, the options may change.)

When you’re done assigning shortcuts, clicking the Start button on the Setup screen makes them available. (The Add button adds Shortcuts’ background process to your Login Items so your shortcuts are available each time you log in.) A list of your assigned shortcuts is available on the Shortcut List screen.

Two other options are also available on the Setup screen. If you plan on using Shortcuts with contextual menu plugins that work with text in Cocoa applications, the Install button installs a helper InputManager that makes it possible for Shortcuts to work with such plugins. And if you enable one of the bezel window notification options, Shortcuts will flash, onscreen, the name of any contextual menu item you activate via a keyboard shortcut. I recommend using this option, as it can be useful in situations where you accidentally press a shortcut—instead of wondering what happened, you know exactly what command was just executed.

The big caveat to Shortcuts, and why it doesn’t receive a higher rating, is that it works only with contextual menu plugins . That is, it doesn’t work with contextual menu items added by applications themselves. For example, BBEdit’s contextual menus include several items, such as Set Marker and Find In Reference, specific to BBEDit; you can’t assign keyboard shortcuts to these contextual menu items via Shortcuts. (The good news is that many of these application-specific items are also available via the application’s own menus, so you can assign keyboard shortcuts to them via Mac OS X’s own Keyboard & Mouse preference pane.) And even some contextual menu plugins , because of the way they’re written, won’t work with Shortcuts.

On the other hand, some of Mac OS X’s own contextual menu items—Automator items, for example—are made available by built-in plugins, so they are available to Shortcuts.

Now, granted, the thing about contextual menus is that, well, they’re contextual. Which means that the mouse cursor is often right on top of the target of the desired action, and you’re often holding the mouse in your hand. So wouldn’t it be easier to just right-click (or Control-click)? If you’re a mouser, perhaps. But I’m a keyboard person, and there are times when I use the keyboard for “mouse-like” things. For example, in the Finder, I often type a few letters of an item’s name to select it, and in a text editor or word processor, I use keyboard commands to highlight text. In such situations, reaching for the mouse is what I’m trying to avoid .

There are also other contexts in which this feature comes in handy. For example, I previously reviewed NuFile (   ), a contextual menu plugin that lets you create a new document for whatever application you desire by right-clicking in a Finder window. You can actually use Shortcuts to assign keyboard shortcuts to each document type listed in NuFile’s contextual menu—I’ve assigned Control+Options+Command+B to create a new BBEdit document in the current folder.

In other words, if, like me, you prefer to use the keyboard to a mouse, Shortcuts is a nifty tool.

To comment on this article and other Macworld content, visit our Facebook page or our Twitter feed.
Shop Tech Products at Amazon