TextExpander

Can LaunchBar Snippets replace TextExpander?

Screenshot of the option added by SymbolicLinker to the Finder contextual menu.

A few weeks ago, LaunchBar 5.5 update brought — among other interesting things — a new feature called Snippets, which actually is a complete overhaul of its previous “Text Clippings” feature. As the devs advertised Snippets as “a serious text expansion tool”, I was curious to see how this compares to one of the references in text substitution on the Mac: TextExpander.

So, for one week, I did a little experiment: I closed TextExpander and acted as if it was never installed on my Mac, and chose to use only LaunchBar instead. Read on to find out how all of this turned out.

 

Like the article? You should subscribe and follow us on twitter.

Before you read on, I must warn you: if you use TextExpander to perform scripts and so on, the Snippets feature of LaunchBar can’t do that. But if you’re just using TextExpander to, well, expand text as I do, or occasionally add dates/times and grab something from the clipboard, then LaunchBar Snippets and TextExpander play in the same field.

Setting up LaunchBar for text expansion

In this little tutorial, I’ll guide you through how to create snippets and how to use them. Also, one of the welcome features of TextExpander is the ability to synchronize your snippets between machines using Dropbox. LaunchBar does not offer this out of the box, but it’s not that difficult to achieve it. I’ll show you first how to do this, so your newly created snippets will instantly be available everywhere (except on iOS of course, we’re talking about LaunchBar here).

Synchronization

To synchronize all of your LaunchBar snippets between machines, follow these simple steps:

  1. First, quit LaunchBar, just to make sure you don’t mess up with anything in progress.
  2. LaunchBar snippets are stored in ~/Library/Application Support/LaunchBar/Snippets. Copy this folder to Dropbox. I chose put this Snippets folder within a newly created folder /Dropbox/Applications/LaunchBar.
  3. Create a symbolic link for this folder you’ve just put in Dropbox. You can do this either the simple GUI way by downloading SymbolicLinker, which will give you a contextual menu within the Finder to make symbolic links.
  4. You now have a ‘Snippets symlink’ folder. Move it back to /Users/[yourusername]/Library/Application Support/LaunchBar/Snippets
  5. Delete the old Snippets folder in ~/Library/Application Support/LaunchBar.
  6. Rename ‘Snippets symlink’ to simply ‘Snippets’.
  7. Restart LaunchBar.

SymbolicLinker makes it a cinch to create a symbolic link, if you’re not familiar enough with UNIX commands and Terminal.

That’s all! Now every snippet you create on one machine will be available on other Mac too.

Creating new snippets

There are many ways of creating new Snippets in LaunchBar.

Create a new snippet from scratch with the ‘Add Snippet’ action

If you want to create a new snippet from scratch, just press your general keyboard shortcut to activate LaunchBar (Cmd-Space in my case) then:

  1. Start typing Add Snippet (remember: never type spaces in LaunchBar commands, these will activate Quick Look — typing “addsnip” without the quotes should be enough to highlight the corresponding action). Once the Add Snippet action is selected, press Enter.
  2. In the field right next to “Add Snippet”: type the text you want to store as a snippet.
  3. Press Enter: You’ve just created a new snippet in LaunchBar!
Screenshot showing the Add Snippet action.

Writing some text to be stored as a snippet in LaunchBar is easy.

Overtime, due to the learning algorithm of LaunchBar, you will have to type less and less. After a few uses, I just need to type ‘as’ and ‘Add Snippet’ is the first match in the list.

Instant Send then ‘Add Snippet’

If you’ve already typed something in, say, your favorite text editor, or if there is some text within a document or a web page that you want to store as a snippet, then perform the following steps:

  1. Select the text.
  2. Use the Instant Send of LaunchBar (you can simply use your keyboard shortcut to activate LaunchBar and hold the last key a bit longer to do this; as I use case Cmd-Space for LaunchBar, I just press Cmd and hold Space for one second to achieve this).
  3. Press Tab.
  4. Start typing ‘Add Snippet’ (without the quotes and without space) to make LaunchBar match this action name. Once the ‘Add Snippet’ action is highlighted, press Enter.
Screenshot showing the result of an Instant Send selection.

Here, I’ve selected the “Select some text” words from the previous paragraph and passed it to LaunchBar via Instant Send: the orange icon on the right indicates you’ve successfully gotten your selection into the app.

Create a snippet from items stored in the Clipboard history

If you have some text stored in your Clipboard history that you’d like to store as a snippet:

  1. Make LaunchBar show your Clipboard History (see the “Show clipboard history:” field in the “Keyboard Shortcuts” list from the Clipboard tab in LaunchBar preferences to define your own shortcut for this)
  2. Select (with Up or Down arrow) the desired text
  3. Press Tab and type “Add Snippet” (without quotes and without space, as usual)
  4. Once you’ve pressed Enter, a new snippet is created based on this item from your clipboard history

Playing with placeholders

As you might expect from “a serious text expansion tool”, you can use some placeholders in your snippets. The most common ones are:

For dates, you can specify a format by using different “YYYY MM dd” combinations or simply use the shorthands , , and . The shorthands will reflect what you’ve set in the Formats tab of the “Language & Text” category in OS X System Preferences. Same thing with the various placeholders.

If you don’t want to try and guess which combination of letters to use to craft …read more