,

Create Snippets as You Go

You’ve seen how to use the normal TextExpander application interface, complete with Dock icon and menu bar, and you’ve seen how to use the TextExpander quick-access menu interface, which offers most of TextExpander’s features and capabilities from a single icon menu.

With OS X services and TextExpander hotkeys, however, you don’t even need to clutter your menu bar or Dock with TextExpander icons if you don’t want them: you can get much of the TextExpander functionality you need right from your keyboard.

This chapter tells you how to set up OS X services to enable the snippet creation and editing commands on the TextExpander quick-access menu. It explains how those commands work, and it shows you how to set up hotkeys so you can use those commands—and others—without reaching for your mouse or trackpad at all.

Set Up Your Services

Pardon me while I make a brief excursion into OS X geekery. Trust me, I’ll be brief, and you don’t have to understand why you need to do what I’m going to tell you to do in this short section. In fact, you can skip the next paragraph of background information if it makes your head spin: just follow the steps that follow it, and all will be well.

TextExpander’s quick-access menu provides commands for creating new snippets, including Create Snippet from Selection. This command makes a snippet from text that you’ve selected in another application, such as a phrase in a word processor or a passage on a Web page. TextExpander uses an OS X system service to communicate between the app in which you’ve selected the text and TextExpander’s snippet creation feature. TextExpander installs this system service the first time you run TextExpander. However, before you can use the Create Snippet from Selection command, you must enable the service; while TextExpander can install the service, it can’t enable it on its own.

Before you can use the Create Snippet from Selection command, do the following (if you don’t, you’ll see the dialog in Figure 33):

**Figure 33:** This dialog appears the first time you attempt to create a snippet from a selection, if you haven’t yet turned on the required service.
Figure 33: This dialog appears the first time you attempt to create a snippet from a selection, if you haven’t yet turned on the required service.
  1. Choose Apple  > System Preferences > Keyboard > Shortcuts.
  2. In the column on the left, click Services.
  3. In the column on the right, scroll down to the Text group of services, click the triangle to open the group if it is closed, and then enable the Create TextExpander 3 Snippet service. (In case you’re wondering, the dialog and the Services list say “Create TextExpander 3 Snippet” because that service was developed for TextExpander 3 and it remains the same for TextExpander 5.)
  4. Close the Keyboard preferences window.

From now on, you can use the useful Create Snippet from Selection command with impunity.

Use Hotkeys

As you have seen in other parts of this book, with TextExpander’s quick-access menu you can access all of your snippets, create new ones, search them, and more. However, using the menu interface requires that you move your pointer to the menu—if you are in a creative frenzy, with your fingers dancing productively across your keyboard, reaching for your trackpad or mouse can be an annoying distraction. With hotkeys, you can avoid that distraction.

A hotkey is a character key typed in conjunction with one or more of the following modifier keys: Option, Shift, Command, and Control. Like keyboard equivalents for menu commands used in many Mac programs, hotkeys can invoke a variety of TextExpander-related actions. Figure 34 shows the hotkeys you can set in TextExpander’s preferences.

**Figure 34:** You can set hotkeys for eight TextExpander actions.
Figure 34: You can set hotkeys for eight TextExpander actions.

To set one or more hotkeys, do the following:

  1. Choose TextExpander > Preferences > Hotkeys.
  2. Click any of the buttons to the right of a command listed in the window, such as Create New Snippet.
  3. Press the key combination you want to assign to that command.

The hotkey takes effect as soon as you assign it.

You can clear a hotkey just as easily:

  1. Open TextExpander > Preferences > Hotkeys.
  2. Click the button to the right of a command that has the hotkey you want to clear.
  3. In the dialog that appears, click Disable.

You can tell when a hotkey has been cleared, or has never been set: its button reads Click to Set Hotkey.

Create a New Snippet

You don’t need to see the TextExpander window to create snippets. The TextExpander quick-access menu provides three commands for creating snippets, and each of those commands can have a hotkey equivalent:

  • Create New Snippet: If you choose this command, TextExpander opens a window above the frontmost application (Figure 35). You use this window to enter the snippet’s content, assign an abbreviation, and designate the snippet’s group. The snippet is created when you click Create; you can click Open TextExpander to work in the full-featured TextExpander window instead.
**Figure 35:** Create a new snippet while working in another app.
Figure 35: Create a new snippet while working in another app.
  • Create Snippet from Selection: If you have text selected in the frontmost application, this command opens a Create Snippet window like the one in Figure 35 (above), but with the selected text in the Snippet Content field.
  • Create Snippet from Clipboard: Whatever you have on the clipboard appears in the Snippet Content field of the Create Snippet window.

There are a few limitations and interesting behaviors to keep in mind when you use these Create Snippet commands:

  • You can’t click outside the window: If you click anywhere outside of the window, the window closes as though you had clicked the Close button. You cannot, for example, issue the Create Snippet command and then drag text into the window: the moment you click on some text to drag, the window goes away. On the other hand, the Create Snippet from Clipboard and the Create Snippet from Selection commands eliminate most reasons to drag text into the Create Snippet window.
  • You can’t choose a snippet type: The window provides no way for you to choose the type of snippet being created. Instead, the window creates a snippet of whatever type is the Default Snippet Format as specified in TextExpander’s Expansion preferences (see Figure 27 in Set Expansion Options). For example, if the clipboard contains styled text and a picture, and the default snippet format is Plain Text, the Create Snippet from Clipboard command inserts only the unstyled text from the clipboard.
  • You cannot label the snippet: Instead, the snippet label is the same as the snippet’s content. You can change the label later in the full TextExpander window.

Edit the Last Expanded Snippet

Nobody’s perfect: suppose you expand a snippet and your eagle eye detects that it contains a typo that you completely overlooked when you created the thing. You could open TextExpander, find the snippet among the many that you have in your collection, select it, and then make the fix. However, in cases like this it’s easier to use the Edit Last Expanded Snippet command. This command saves you a trip into the TextExpander window, which can be both distracting and an all-too-tempting excuse for procrastinating.

The Edit Last Expanded Snippet command, available from the TextExpander quick-access menu or from a hotkey you assign, displays a window like the one shown in Figure 36.

**Figure 36:** Quick and easy snippet editing, courtesy of the Edit Last Expanded Snippet command.
Figure 36: Quick and easy snippet editing, courtesy of the Edit Last Expanded Snippet command.

Use this window to make any changes you need to the snippet content, to its abbreviation, or both, and click Save.

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

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