You’ve seen how LaunchBar can help you save time by enabling you to launch applications, find files, and search the Web with just a few keystrokes. Another feature, recently added to LaunchBar, is Snippets. Snippets are bits of saved text that you can then insert anywhere you can type. In this chapter, I’ll tell you how to use Snippets to save time when typing.
LaunchBar’s Snippets feature is a great time-saver, allowing you to configure bits of text—from single words to long boilerplate texts—and have them “typed” for you by just pressing a few keys. Snippets can contain placeholders for things like the current date or time, or the contents of the clipboard. Also, you can direct LaunchBar to position your text cursor at a specific location in an inserted snippet.
To create a new snippet, you first view the Add Snippet field on the bar. Then, you fill in the text of your snippet and save it. You can optionally apply formatting.
Like any other indexed LaunchBar item, you can now call up this snippet with an abbreviation search. To learn more about methods of inserting a snippet, read Use Snippets, ahead.
By default, LaunchBar stores snippets as plain text: it saves only the words and characters, but doesn’t store information about specific fonts, sizes, or styles, such as bold or italic.
Optionally, for a rich text snippet, with styles, do the following:
The next time you insert the snippet, LaunchBar pastes the styled version, as long as you’re in an application that can accept styled text.
In addition to storing text, a snippet can contain placeholders that will be replaced with certain information when you insert the snippet. Here are a few examples:
<date short>
, <date medium>
, or <date long>.
The inserted date will use the corresponding format specified in the Region view of the Language & Text pane of System Preferences.time
instead of date
. For example, <time long>
could show the time as 3:26 PM GMT.<clipboard>
placeholder when a snippet is inserted. You can use an item from your clipboard history with a placeholder such as <clipboard 7>
(Figure 24). (See Save Time with Clipboard History.)
<!>
placeholder when a snippet is inserted. This is a good way to position the cursor at a specific point in an inserted snippet for you to type something—imagine having a snippet that starts a letter, with the cursor ending up right before the comma in the salutation, as in Dear |,.If you’ve created a snippet and want to change part of its text, here’s how you can edit it. Select the snippet below the bar—for example, you can do this via sub-search of the Snippets indexing rule, or by an abbreviation search for the snippet. Press Shift-Return to open the snippet in whatever app your Mac uses by default for either plain text or rich text files (this depends on whether the snippet is plain text or rich text), make the changes you want, save the file, and then close it.
To delete a snippet, invoke the bar, select the snippet, then press Command-Delete. You can’t undo this action. However, since snippets are stored as text files, if you accidentally delete one, you can find it in the Trash, Control-click it, and choose Put Back to replace it.
You can also temporarily disable a snippet in the LaunchBar index. This works like disabling any other item in the index, as discussed in Cull Items from Indexing Rules.
Once you have a collection of snippets, it’s time to use them. As you probably suspect, you can find snippets with an abbreviation search, which is made easier by assigning a custom abbreviation, as I explained earlier in this chapter. But you can also access your snippets in the following ways:
When you display your snippets, the most recently used snippet will be at the top of the list. Figure 25 shows a snippet list.
When you’ve found the snippet you want to use, press Return to insert it in your current application, at the position of your text cursor. If you wish, you can press Command-C to copy it and paste it elsewhere.