Automate Text Expansion

Even if you’re a great typist, you can save time and increase your accuracy by using software that watches what you type and dynamically replaces abbreviations you’ve previously specified with longer chunks of text. (And if you’re not a great typist, such software can increase your effective typing speed!)

I mentioned earlier that whenever I type dttg, my Mac automatically expands that into DEVONthink To Go. That’s just one of dozens of abbreviations I use in my own work. I also use TCo to produce Take Control of, syp to produce System Preferences, and so on. The longer and more complex the text in question, the more useful automatic text expansion becomes.

Text expansion isn’t just for names and short phrases. You can use it for addresses, phone numbers, URLs, boilerplate text for common email replies, HTML code snippets, and so on. Depending on which software you use for text expansion, your snippets might also include styles (such as bold and italic), graphics, the current date or time, variables, AppleScripts or shell scripts, the contents of the clipboard, and more.

The great thing about text expansion is that you don’t have to do anything special to use it—you simply type. You don’t need modifier keys like Command or Control, and you don’t need to hunt for menu commands. And it can be used nearly anywhere.

One catch, however, is that you must be careful when choosing abbreviations—since text expands as you type, you might end up making a lame mistake if you’re not paying attention. For example, I thought I’d use km as an abbreviation for Keyboard Maestro, but then I tried typing a distance in kilometers and got a surprising result! So be sure to use abbreviations that will never occur on their own, or even as part of another word. One technique many people use to solve this problem is to double the first or last letter, as in kmm for Keyboard Maestro. Another is to add a slash (/) to the beginning of each abbreviation.

Use Text Replacement in macOS

macOS includes its own rather rudimentary text-expansion capability, known as text replacement.

To configure text replacement:

  1. Go to System Preferences > Keyboard > Text (Figure 25).

    Figure 25: Set up macOS text replacements here. This image shows the window after numerous replacements have been added.
    Figure 25: Set up macOS text replacements here. This image shows the window after numerous replacements have been added.
  2. Click the plus button.

  3. Type the text you’ll type in the left-hand (Replace) field, and then type the text you want to end up with in the right-hand (With) field.

  4. Press Return.

Repeat these steps as needed to add further abbreviations.

Once configured, text replacement is seamless: you type one of your abbreviations, and as soon as you press a trigger key—Space, Tab, or Return, or a punctuation character—the abbreviation is replaced with the text you’ve specified. Abbreviations are not case-sensitive, so if you set up myurl to expand into http://www.myurl.com/, then that will happen even if you type MyURL.

Your abbreviations even sync across your Macs and iOS devices if they’re all signed in to the same iCloud account and iCloud Drive is selected in System Preferences > Apple ID > iCloud (Catalina or later) or System Preferences > iCloud (Mojave or earlier).

Although text replacement works well enough for what it is, this feature has numerous limitations:

  • It doesn’t work in all apps; the only way to know where it does work is to look for the Edit > Substitutions > Text Replacement menu command, make sure Text Replacement is selected, and then try your abbreviations. (For example, it doesn’t work in BBEdit or Word—but Word has its own built-in text-expansion feature.)

  • If your replacement text is longer than about 25 characters or uses the Option-Return trick for multiple lines, the text will be cut off in the Keyboard preference pane—you won’t be able to read it.

  • You can’t configure the trigger characters that cause abbreviations to expand.

  • You can’t include styled text, graphics, variables, or other such niceties.

So, if you like the idea of text expansion but find the Mac’s built-in feature too limited, it’s time for a more powerful, third-party tool.

Use a Third-Party Text Expansion Utility

For vastly more power and flexibility when it comes to text expansion, turn to a third-party utility. At the moment, I’m aware of four main contenders for macOS that are under active development: aText, TextExpander, Typinator, and TypeIt4Me. (For the purpose of this topic, I’m restricting myself to standalone tools for text expansion. There are also multipurpose tools that can perform this task. Alfred, a launcher app, also includes an automated text expansion feature in its optional Powerpack add-on. BetterTouchTool can also use a key sequence to trigger an action, including typing replacement text; see Use BetterTouchTool. And Keyboard Maestro can use arbitrary typed shortcuts to launch any macro, including one for typing or pasting text; see Control Your Mac with Keyboard Maestro.)

These four tools share many features in common beyond mere text replacement—for example, all of them can:

  • Insert the current date or time (or a portion of it, such as “Tuesday”)

  • Respect case when expanding abbreviations

  • Insert snippets that include styled text and graphics

  • Ignore certain apps where you don’t want text expansion to occur

  • Include the contents of the clipboard in the expanded text

  • Perform simple calculations on numbers and dates, including variables

  • Reposition the insertion point to any arbitrary location after expanding text

  • Use abbreviations to trigger AppleScripts

  • Sync clippings and abbreviations via Dropbox

These four utilities are much more alike than different, and most users should be equally content with any of them. I will, however, point out a few distinguishing characteristics:

  • aText: aText strikes me as having the least-polished interface of the four utilities—it doesn’t even include online help or any other documentation—but what it lacks in looks it makes up for in an extensive feature set. Among other things, snippets can include editable fields, and can launch shell scripts as well as AppleScripts. aText is also the least expensive option, at $4.99.

  • TextExpander: Like aText, TextExpander has editable fields for fill-in-the-blanks snippets. It also includes some spiffy predefined shortcuts, such as one that uses AppleScript to shorten any URL on your clipboard with a service such as bitly.com or is.gd. And, there’s an iOS version (TextExpander for iPhone & iPad), which can sync snippets with the Mac version. We’ve included a coupon at the end of the book for a 30% discount on a one-year subscription to TextExpander.

  • Typinator: Typinator, from the developer of KeyCue (discussed earlier) is right up there on the feature comparison checklist, with fill-in-the-blanks snippets, date and time calculations, and scripting support, among dozens of other capabilities. You can download a free AppleScript snippet called Conversions that performs currency conversions (among other things). Typinator also supports regular expressions, which means that expansions can be triggered with user-defined patterns, not just fixed abbreviations—and the replacements can also be pattern-based. However, unlike the other apps in this list, Typinator doesn’t let you define which delimiters trigger expansion—abbreviations can expand either as soon as you finish typing them or at word boundaries, but you can’t specify which characters can signal the end of a word. And unlike TextExpander and TypeIt4Me, it currently has no iOS counterpart. At the end of this book, there is a 30%-off coupon for Typinator.

  • TypeIt4Me: TypeIt4Me has been around the longest—since way back in 1989! As a result, it feels a bit dated in spots. For example, its fill-in-the-blanks feature, called AutoCue, pauses expansion of a snippet, with text selected, while you enter the content you want, and then continues when you press Tab. That’s clunkier than a simple dialog with fields for entering all the values at once, but it gets the job done. On the other hand, it can use Apple’s spelling dictionaries (in multiple languages) for autocorrect. It also has an iOS counterpart (TypeIt4Me Touch), although it’s not quite as capable as TextExpander for iPhone & iPad. You can save 30% on TypeIt4Me with the coupon at the end of this book.

The more time you spend working with a text-expansion tool, the more ideas you’ll come up with for putting it to good use. Here are a few I haven’t mentioned already:

  • Enter special characters without remembering how to type them. For example, eurosymbol could “expand” to €, while rightarrow could produce → and thumbsup could give you the ? emoji.

  • Enter several paragraphs of greeked text (which is usually, in fact, based on Latin) such as “Lorem ipsum…” with a quick abbreviation, such as lipsum.

  • Type your Twitter handle, with or without an embedded, clickable link, with an abbreviation such as @tw.

  • Replace your email app’s signatures with custom signature snippets that appear wherever and whenever you need them.

Just to show you how this works, let me walk you through the steps of creating and using an abbreviation in TextExpander:

  1. Open the TextExpander app.

  2. Click the New Snippet button.

  3. In the main content area, type the text you want to end up with, such as supercalifragilisticexpialidocious.

  4. In the abbreviation field, type the abbreviation you want to use, such as scfl. (Be sure not to reuse an abbreviation you used in System Preferences > Keyboard > Text.)

  5. Close the TextExpander window.

  6. Now open an app where you can type text (like TextEdit or Mail).

  7. Type your abbreviation scfl and then a space or other punctuation. With a “pop” sound, your abbreviation disappears and is replaced with “supercalifragilisticexpialidocious.”

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

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