Services

The Services submenu can be found under most any Aqua program’s application menu. It allows the foreground application to invoke functions of other applications, usually while passing along user-selected text or objects to them.

The Service menu’s contents depend on the applications installed on your Mac. When installed, some applications like Mail and BBEdit can place entries in the Services menu. If an application provides more than one service, those items will be placed into a submenu named after that application.

As seen in Figure 1-35, Mail provides two services under Application Services Mail Send To.

The Services menu

Figure 1-35. The Services menu

If you have some text or images selected in the foremost application and select Mail Text, the Mail application creates a new email message whose body consists of that selection. Selecting an email address in any application and then choosing Mail’s Mail To service will also create a new email message, this time pre-addressed to the selected address. In both cases, the Mail application launches (if it wasn’t already active) and makes itself the active application.

Some services make themselves especially easy to invoke through key bindings, which remain omnipresent throughout your use of the OS. The Make Sticky service turns any text you’ve selected into a new sticky note, and is bound to the key combo Shift-

The Services menu

-Y.

Tip

Applications define the services they offer through the Info.plist files found within their bundles. See Chapter 22 for more information.

Of course, an application might have its own idea about what Shift-

The Services menu

-Y means! An application’s own key bindings always trump those in the Services menu. Services know when the current application has a binding that conflicts with theirs and might try to offer alternative keystrokes, changing its binding indicator in the Services menu to reflect this. If all of its bindings raise conflicts, it stops trying altogether, and can only be used through the Services menu for that particular application.

Get Mac OS X in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.