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.
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).
To synchronize all of your LaunchBar snippets between machines, follow these simple steps:
- First, quit LaunchBar, just to make sure you don’t mess up with anything in progress.
- 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.
- 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.
- You now have a ‘Snippets symlink’ folder. Move it back to /Users/[yourusername]/Library/Application Support/LaunchBar/Snippets
- Delete the old Snippets folder in ~/Library/Application Support/LaunchBar.
- Rename ‘Snippets symlink’ to simply ‘Snippets’.
- Restart LaunchBar.
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:
- 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.
- In the field right next to “Add Snippet”: type the text you want to store as a snippet.
- Press Enter: You’ve just created a new snippet in LaunchBar!
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:
- Select the text.
- 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).
- Press Tab.
- 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.
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:
- 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)
- Select (with Up or Down arrow) the desired text
- Press Tab and type “Add Snippet” (without quotes and without space, as usual)
- 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