Thursday, August 12, 2010

How to Use Text Expansion to Save Yourself Hours of Typing Every Week

By The How-To Geek

How to Use Text Expansion to Save Yourself Hours of Typing Every Week

TextExpansionTitleImage.png In a regular day, most of us type the same things over and over again, wasting an enormous amount of time in the process. Why not let your computer do some of that work for you? That's where text expansion comes in.

What Is Text Expansion?

How to Use Text Expansion to Save Yourself Hours of Typing Every Week
Text expansion utilities monitor your typing and trigger rules when you type a predefined phrase or key combination. When you type one of those pre-defined phrases, your text expansion utility removes your short version and replaces it with a longer phrase without requiring you to type the entire thing—saving you loads of keystrokes and time. Watch the video above for a few examples of text replacement in action.

For instance, you could create a text expansion rule that triggers anytime you type sig and hit the space bar, and fills in your entire email signature line—or you could set a trigger to fill in a canned email response, or just a common word or phrase that would take a long time to type manually. It's all about saving time and keystrokes.

Setting Up Text Expansion

When it comes to text expansion tools, you've got lots of choices depending on the platform you're running. Here's a couple of tools that we've used, and some basic instructions on getting them running.

Using PhraseExpress in Windows
There's a number of choices for text expansion in Windows, but PhraseExpress is the only one I've tried that's very powerful, free for personal use, and also works in Windows 7. The standard edition is free for personal use, but it has an internal word list that will nag you if you try and use rules containing phrases like "your order".

New rules in PhraseExpress are called "Phrases", and can be triggered with an "Autotext", or a hotkey. The "Postfix" drop-down lets you choose what key will trigger the rule—for example, if you have it set to Tab, then in the example below you'd have to type "hre" and hit the Tab key to trigger the phrase content for replacement.

How to Use Text Expansion to Save Yourself Hours of Typing Every Week

PhraseExpress has a lot of other features, like a popup menu that will allow you to choose between different phrases before they are entered, libraries of common typos that you can download and use, and a whole lot of other options.

Note: Once you've installed PhraseExpress, you'll probably want to delete the rules folder called "Websites", since it's got a bunch of affiliate link rules in there that automatically replace certain websites with affiliate links when you're typing them into your browser.

Using Texter in Windows
How to Use Text Expansion to Save Yourself Hours of Typing Every Week
If you're not on Windows 7 yet, you can use Lifehacker's own Texter utility for text replacement. It's open source, free, and has some very powerful scripting support included, but unfortunately it has a few frustrating bugs in Windows 7. (If you're interested in helping Texter work better in Windows 7, we'd love to let anyone contribute to the source.)

Adding a new rule in Texter is very easy—just use the tray icon to create a new hotstring (or press Ctrl+Shift+H), add the short string you'd like to use in the Hotstring box, put in the full replacement text, and then choose whether you want it activated immediately or after you press Enter, Tab, or Space. Here's a short video that shows Texter in action:
How to Use Text Expansion to Save Yourself Hours of Typing Every Week

Using AutoHotkey Hotstrings
If you're the more adventurous type who doesn't mind writing scripts, you can hack together your own text expansion with AutoHotkey's Hotstrings syntax—it's the way that Adam showed us how to knock down repetitive email with AutoHotkey a long time ago, and it works well if you're already using AutoHotkey and only have a few text expansion rules that you'd like to create.

The general idea is to create a new AutoHotkey script, and paste in a new line with this syntax:

:oc:TRIGGERTEXT::REPLACETEXT

For instance, if you wanted to setup a rule so that every time you type |e and hit Space that it will fill in your email address, you can use a rule like this:

:oc:|e::geek@howtogeek.com

The "o" in the beginning of the string says to don't actually add the Space or Tab key when doing the replacement, the "c" makes the rule case sensitive, and if you were to add a "*" character where the "oc" is, it would make the rule happen immediately rather than waiting until you hit a special character like Space, Tab, or Enter.

You can actually use any AutoHotkey code for the REPLACETEXT in the example, as long as you end it with a Return-so if you wanted to trigger a more indepth script to figure out a timestamp or do something else, it would be fairly easy. See the Hotstrings documentation for more information.

Use Autokey in Linux
If you're a Linux user, you can use the AutoKey application to create powerful text expansion rules—and if you're familiar with Python, the sky's the limit for what you can accomplish with this application, since the rules can also contain Python code that can do anything.

You can create a new rule that is triggered with a hotkey or a text phrase, and you can even choose them from the tray menu or a popup menu if you prefer. It's simple and easy to get started with.
How to Use Text Expansion to Save Yourself Hours of Typing Every Week

Use Textexpander for Mac
If you're a Mac user, TextExpander is the way to go—it's not free, but it's got every feature that you might want, and there's a free trial version that you can use to see if you like it. (In some Lifehacker writer's experience, you can use the trial indefinitely—if you can put up with the nags.) They've also got built-in snippet groups for HTML, CSS, common misspellings, and accented words that are a pain to type normally.
How to Use Text Expansion to Save Yourself Hours of Typing Every Week

What Types of Text Expansion Rules Should I Use?

Ultimately, you're going to need to figure out what rules are best for you-take a look at your normal workflow and figure out exactly what you're wasting the most time typing repeatedly, and add some text expansion rules to fix the worst offenders. Over time, you'll get used to how it works, and add more rules. That said, here's a few ideas on how text expansion can help you:

Multiple Signatures
Text expansion can help you solve the problem of needing multiple different signatures for your email—all you need to do is create a set of text expansion strings tied to something like sig1, sig2, and so on, with the different signatures for each one. You could use one for work related email and one for personal, or different signatures based on the contract you're working on—it's up to you.

Canned Email Responses
Answering email can be an enormous time suck, and if you analyze your email habits you'll probably find that there are certain responses that you write over and over, which would make them a perfect candidate for text expansion. You can assign separate responses for each type of response—I like to use :can as the prefix to my responses, so my normal thank you response might be :canthx, or the "Thanks for the update, we'll look into that!" might be assigned to :canup.

Frequently Used Bits of Text
While we're on the subject of email, there are often pieces of emails that are so frequently used that they could also be considered for text expansion—for example, if you often ended your emails by saying something like "We should discuss this next week", you could assign that string to a shortcut of :nw and easily save yourself 29 keystrokes every time.

You could also create a text expansion string for your full contact information, if you find yourself frequently using it in an email but don't want to have it in your normal email signature.

Simplify Writing for the Web
If you do a lot of writing for the web you'll probably need to deal with HTML at some point, especially if you're working with a system that doesn't have a decent editor. You can save yourself an enormous amount of time by setting up text expansion snippets for HTML links and other common elements.

Since a lot of HTML elements are more complicated than a simple expansion, you can use the more advanced features of your text expansion application to paste from the clipboard, and then put the cursor in the right place so you can continue typing. For example, here's the rule that I use in PhraseExpress for creating an HTML link:

<a href="{#insertclipboard}">{#cursor}</a>

Now whenever I type "hre" and hit the Tab key, PhraseExpress will paste that string in, replacing the {#insertclipboard} section with the URL that I already pasted on my clipboard, and it will position the mouse cursor where the {#cursor} part of the string is, so I can type the name of the link.

Common Code Snippets
If you're a programmer, you can save yourself a ton of time by adding your boilerplate code to your text expansion tool, or even adding lines of code that you find yourself typing all the time. If you dig into the options in your IDE, you'll probably find that you already have a lot of these features built in, but if you're the type that uses a text editor to write code, this would be a great way to save some time. (The video above demonstrates how to use Texter for this very purpose.)

Email Address and Phone Number
How often do you type out your own email address and phone number? You can save an enormous amount of time by simply assigning a really short string to output your email address, phone number, or other similar data like this. What I do is assign :e to fill out my email address, and :n to output my phone number—this saves time when filling out forms, or just typing your email address into a login box.

Address for Order Forms
Typing your address into an online order form can be a pain, but text expansion can make it a lot easier. You can assign a short code like :addr to expand out your address, but you can take it a step further if you want—if you use the special keys insertion of your text expansion application you can add a Tab key press to your string, which will actually tab to the next field on the form. For example, if you're using PhraseExpress you can use a string like this:

123 Geeky Way{#TAB}{#TAB}Vienna{#TAB}vv{#TAB}90210

You'll notice that the string for the State section uses the "v" key twice—since I live in Virginia, I have to hit that key twice to switch the normal State dropdown box to Virginia. The same thing works for text expansion.

Fixing Common Typos
I can't even count the number of times I've gone to type something like "hehe" into my IM client and ended up with "heeh" or "hee" instead. You can use text expansion to automatically replace your worst typos with the correct thing—for best results, you should set the rule to immediately do the replacement without requiring another key to be pressed.

Inserting Special Characters and Symbols
Pulling out the Character Map utility every time you want to insert a copyright symbol, or some other special character, can be a bit of a pain. If you have to use special characters all the time, you should simply assign some rules to them instead-for example, :copy could be assigned to ©. Depending on the tool you're using, you can probably assign a single hotkey to some of them—I have Ctrl+—assigned to insert an em-dash, since the WordPress quick editor doesn't have a button for it.

Date and Time
Just about any text expansion utility will let you easily insert the date and time—you can assign something like :date and :time to insert one or the other, or you could make it shorter if you wanted.

Common Folders for Windows Dialogs
Browsing your Windows filesystem in the file open and save dialogs can be a waste of time, and just plain annoying. You can save yourself a lot of time by assigning a string to automatically fill in your most common paths—and it works even better if you use the special characters feature of your text expansion application to add an Enter key press to the end of it, which will force the dialog to switch to that folder. For example, I have :db assigned to this string:

C:\Users\Geek\My Dropbox\{#ENTER}

This automatically switches me into the Dropbox folder by simply typing the :db string into the filename box in any open or save dialog.
How to Use Text Expansion to Save Yourself Hours of Typing Every Week


What about you? Do you use text expansion in your daily workflow? What rules do you use? Share your advice with your fellow readers in the comments.


The How-To Geek used :lhsig to fill in this signature line. His geeky articles can be found daily here on Lifehacker, How-To Geek, and Twitter.

Number of comments
  • Share this:

No comments:

Post a Comment

CrunchyTech

Blog Archive