Use Services for System-Wide Shortcuts

In macOS, a service is a special, context-sensitive program that can operate almost anywhere. You can find services on the Services submenu of the application menu (that is, the menu with the current app’s name). Alternatively, right-click (or Control-click) something and choose a service from the very bottom of the contextual menu. (Services appear on a Services submenu of the contextual menu if more than four of them are active and applicable to whatever you selected.)

If you look at this menu in different apps, and with different things selected, you’ll notice that your choices change. For example, you’ll see one set of commands when you select a file in the Finder, a different set when you select text in Mail, and yet another set when you have a graphic open in Preview. That’s because each service is designed to operate only on certain kinds of data, or in certain contexts. The idea is to show you only the commands that are relevant to what you’re currently doing.

Services, like Automator workflows and AppleScripts (discussed later in this book), can perform complex tasks for you with only one click. So they’re fantastic automation tools that every Mac user should be aware of. As we’ll see in a moment, you can use a combination of built-in services, third-party services, and services you create yourself to automate a wide variety of activities.

Before you do anything else, you should configure the services on your Mac to your taste. Not all the services installed on your Mac are necessarily active (only active services appear in the Services submenu); you can enable or disable services as you wish. In addition, you can assign a keyboard shortcut to any service to avoid hunting for it in a hard-to-reach submenu.

Configure Services

To set up Services on your Mac:

  1. Go to System Preferences > Keyboard > Shortcuts > Services (see Figure 42).

    Figure 42: Enable, disable, or add keyboard shortcuts to services here.
    Figure 42: Enable, disable, or add keyboard shortcuts to services here.
  2. Select the checkbox next to any service you want to enable; deselect those you want to disable. (Remember, selected services appear in the Services submenu only when the context—the app and data type—are appropriate.)

  3. To add a keyboard shortcut to a service that doesn’t have one, click the light gray word “none” to the right of the service name and click Add Shortcut. Or, to change an existing shortcut, double-click it.

  4. Press the new key combination you want to use for the service. (To remove a shortcut, select it and press Delete.)

Ordinarily, changes to the Services menu happen immediately, so you can try out your newly activated service or shortcut right away.

Find and Use Services

macOS includes lots of built-in services, which you can explore simply by selecting various kinds of things (text, files, images, URLs) and then looking at the Application > Services submenu. For example, you can select a word and choose Look Up in Dictionary from the Services submenu to open the Dictionary app with that word’s definition showing, or select a graphic in the Finder and choose Set Desktop Picture to make it your Desktop picture without having to open System Preferences > Desktop & Screen Saver > Desktop and adding it there manually. In addition, some apps install their own services.

Beyond what comes with macOS and the apps you already have, there are a great many free services you can download that are extremely useful. For instance:

  • The Download Services page at Mac OS X Automation has dozens of services for images, email, movies, PDFs, web browsing, and other contexts.

  • DEVONtechnologies’ Download page has two services: CalcService (for performing calculations on text selections) and my favorite, WordService (which includes numerous commands for reformatting and manipulating text).

  • Markdown Service Tools from Brett Terpstra help you format text using the popular Markdown syntax.

Once you’ve downloaded a service, move or copy it into /Library/Services (to make it available to all users) or ~/Library/Services (to make it available only to you). Then go back to System Preferences > Keyboard > Shortcuts > Services to enable the specific commands you want to use and assign or change keyboard shortcuts.

But wait, there’s more! You can create your very own service, without any programming at all, using Automator, which I discuss in the next chapter. (For instructions, see the Create Your Own Service).

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset