,

Meet TextExpander

The idea behind TextExpander is simple: it substitutes something you type (usually something short) with something else (usually longer and more complicated) in almost any situation where you can enter text. Although I’ll present a simple example in this chapter, TextExpander substitutions, called snippets, can be complex and extraordinarily helpful: they can include formatted text, images, the current date or time, fields where you fill in information on the fly, the clipboard contents, and more. They can even move the insertion point and run scripts.

But first, some basics. In this chapter, I tell you how to:

After that, you’ll be ready for the next chapter, where you meet the many kinds of snippets you can create, and master how to use them.

Get TextExpander

It should come as no surprise that you’ll get the most value from this book if you have a copy of TextExpander installed on your Mac. You can obtain Smile’s TextExpander from the company’s site.

You can also purchase a Family Pack or Office Pack license from Smile should you need to install TextExpander on multiple machines that are used by more than one person; you can find details about the Family Pack and Office Pack in the TextExpander FAQ.

If you just want to try TextExpander, you can obtain a free trial version from Smile’s site.

Installation is nearly effortless: When you obtain TextExpander from Smile by downloading the trial version, you just unzip the downloaded file (if your Mac doesn’t do so automatically) and drag the application to your Applications folder. When you launch it, you may see a dialog asking you to give TextExpander permission to access your Contacts. This permission makes it a little easier when you use the Snippet Creation Assistant, described just ahead, but is not mandatory: you can click OK or Don’t Allow, as you prefer.

Next you see both the TextExpander app’s main window and the Welcome to TextExpander window, as well as the Purchase/Registration window (Figure 1).

**Figure 1:** This window appears when you launch a new, unregistered copy of TextExpander.
Figure 1: This window appears when you launch a new, unregistered copy of TextExpander.

To use TextExpander in trial mode, click Try the Demo in the Purchase/Registration window.

Or, to purchase a license, click an appropriate link in this window. (If you’ve already closed it, launch the trial version of TextExpander so the TextExpander window is showing and then choose TextExpander > Purchase/Register TextExpander.) After you complete the shopping process in the cart, the registration code automatically appears in the window; click the Register button to complete your purchase.

You can also purchase a registration code through your Web browser. Smile emails you a registration code after you complete the purchase; enter the code by choosing TextExpander > Purchase/Register TextExpander.

So, if you don’t have TextExpander, go and get a copy. I’ll wait.

Run the Snippet Creation Assistant

As I mentioned in the previous topic, the very first time that you launch TextExpander, you see several windows. One of them is the main TextExpander window, perhaps showing the registration window if you haven’t yet registered it, as seen just previously in Figure 1.

If you see the registration window and don’t want to buy or register TextExpander right now, just click Try the Demo. However, keep the TextExpander window open, since you want to watch it change as you work with another of those windows: the Welcome to TextExpander window.

For first time users, the Welcome to TextExpander window shows the first page of the Snippet Creation Assistant, as in Figure 2.

**Figure 2:** The first page of the Snippet Creation Assistant.
Figure 2: The first page of the Snippet Creation Assistant.

Although you can close the Snippet Creation Assistant window immediately and dive right into using TextExpander, I strongly recommend you run through the Assistant if you haven’t already set up your core set of TextExpander snippets—it can save you a lot of time.

The Snippet Creation Assistant helps you create a basic set of snippets and add pre-supplied groups of snippets to your snippet collection. The Assistant also provides pointers and tips for using these snippets, and offers you the opportunity to try some of them out to see how they work in practice.

Here are the kinds of snippets you create or add with the Snippet Creation Assistant:

  • Your contact information: These include a snippet for your email address, one for your phone number, and one for your street address. These are plain text snippets; I describe how to create and modify such snippets more fully in Make and Use a Simple Snippet.
  • Date and Time: These snippets employ TextExpander macros to replace the abbreviation you type with your Mac’s current date and time. I describe macros in snippets generally in Meet the Macros, and discuss the date and time macros in Include Dates and Times.
  • Your email signature: This page of the Assistant gleans your information from your Contacts to create one or more signatures to use in email or elsewhere.
  • Boilerplate replies: The Assistant presents a sample reply snippet to show you how you can quickly reply to common emails with a prepared response.
  • Specialized snippet groups: Smile provides a number of ready-made snippet groups you can add to your collection, including an AutoCorrect group that automatically corrects some common typos, an Accented Words group that replaces non-accented words you may type (like “matinee”) with its correctly accented version (like “matinée”). For the Web developers among you, you can add an HTML and CSS group that can make typing code much more efficient. I describe these groups, and others, more fully in Add a Predefined Group.
  • Fill-in-the-blank snippet: The Snippet Creation Assistant also demonstrates how you can use TextExpander’s Fill-ins snippet type to customize form letters and similar boilerplate text and provides one for you to try out. I describe Fill-ins in Make a Fill-in Snippet.
  • URL shortening snippets: This Assistant page describes how to use URL shortening services with snippets from the Internet Productivity group and offers to add that predefined group to your snippet collection.

    When space is at a premium, being able to use a short URL like http://tinyurl.com/oorug23 instead of http://www.pixel-stained-wretch.com/wordpress/2015/06/13/crichton-and-me/ is very handy.

And now, with your copy of TextExpander stocked with some snippets and snippet groups, it’s time to learn some basic facts about the TextExpander interface and to create your first snippet from scratch.

Know Your Interfaces

Unlike most apps, TextExpander has two faces: the first is a traditional Mac interface, complete with an application window and standard menus on the menu bar; the second is a single TextExpander system-wide menu on the right side of the menu bar. You may be wondering, why does TextExpander have these two different faces?

When it comes to utility applications that work behind the scenes assisting other applications, the standard Mac interface of every application having its own windows and menus can get in the way of the utility doing its job. It’s like that with TextExpander, which is all about working behind the scenes, replacing one chunk of typed text (known as the abbreviation) with another (the snippet) and allowing you to create new abbreviations and snippets quickly, all while you keep working.

The first thing that a new TextExpander user has to figure out is when to use which TextExpander interface. Although every person has an individual working style, I’ve found that these general guidelines makes sense:

  • Use the window interface (Figure 3) when you want to manage your snippet collection, and when you want to create snippets that refer to other snippets. Most of the instructions in this ebook provide steps for using the window interface.
**Figure 3:** Manage your snippet collection with the TextExpander window interface. As you can see, I have developed a substantial snippet collection over the years.
Figure 3: Manage your snippet collection with the TextExpander window interface. As you can see, I have developed a substantial snippet collection over the years.
  • Use the TextExpander single-menu interface (Figure 4) when need to get at your snippets (or create new ones) quickly.
    **Figure 4:** The TextExpander quick-access menu gives you access to your snippets when you’re busy writing.
    Figure 4: The TextExpander quick-access menu gives you access to your snippets when you’re busy writing.

    This menu appears when you click the small TextExpander icon that TextExpander places among the other system-wide menus on the right side of the menu bar. I call this the “TextExpander quick-access menu.” (To learn about creating and editing snippets with this menu, as well as how to assign and use TextExpander hotkeys, refer to Create Snippets as You Go, later in the book.)

Make and Use a Simple Snippet

But enough (for now) of theoretical musings about the interface. The best way to use TextExpander is to use TextExpander! The following sections describe the process for creating and using TextExpander snippets. If it looks complicated, don’t panic: although I’ve laid it out in detail so you can study the process, in normal use you can create snippets in a matter of seconds, and use them as fast as you can type their abbreviations.

Create the Text

The first thing you need to do is to create the text snippet that you want TextExpander to insert whenever you type the abbreviation that stands for the snippet. This text can consist of a word or two, or even a much lengthier passage.

Although TextExpander provides numerous ways to create a snippet, we’ll use TextExpander’s old-fashioned, traditional window interface for this run-through:

  1. Open the TextExpander application, and then, at the top left of the TextExpander window, click New Snippet.

    A new entry appears in whichever group of snippets is selected in the left of the window, and your cursor is placed in the snippet creation area at the window’s right. (Don’t worry for now about snippet groups; I describe how to manage them later, in Organize Your Snippets.)

  2. Type your snippet text in the snippet Content field, which takes up most of the TextExpander window’s right side.

    You can, if you prefer, copy the text from elsewhere and paste it in the snippet Content field; for example, I’ve copied and pasted a typical letter salutation from the mid-15th century “Paston Letters” in the snippet Content field in Figure 5.

**Figure 5:** A snippet in the act of being created.
Figure 5: A snippet in the act of being created.

And that’s all you need to do to create the snippet. However, it is not really usable at this point. Read on to learn about assigning three important attributes to a snippet: the abbreviation you type to insert it (required), a case-sensitivity setting for the abbreviation, and a label in case you can’t recall the abbreviation.

Assign an Abbreviation

For every snippet you create, you need a unique abbreviation. You need an abbreviation because, without one, there would be no way for TextExpander to insert the snippet into your text. You need a unique abbreviation because TextExpander replaces that abbreviation with the actual snippet whenever you type it: if the abbreviation weren’t unique, TextExpander would not know which snippet to substitute when you typed an abbreviation assigned to two or more snippets! Fortunately, TextExpander warns you, by highlighting the abbreviation in orange, when you try to assign an abbreviation used by another snippet.

Here are some other guidelines for snippet abbreviations:

  • Keep them short: There’s not much point to an abbreviation that is nearly as long (or longer) than the snippet it represents.
  • Make them memorable: If you can’t remember your snippet abbreviations, you have to look them up, which loses the time-saving advantages that TextExpander offers you.
  • Make them unusual: Because the abbreviation gets replaced by TextExpander whenever you type it, choosing an abbreviation that often appears in normal text can cause trouble for you. For example, don’t use “me” as the abbreviation for “Medical Examiner” because that’s what will appear every time you refer to yourself in text!

As shipped, TextExpander’s default case-sensitivity setting for abbreviations is to make them case sensitive, although you can change that on a (ahem) case-by-case basis; you can also change the default case-sensitivity setting in TextExpander’s Expansion preferences (note that changing the default does not change the case-sensitivity settings of snippets that have already been created).

Here are your case-sensitivity options:

  • Case Sensitive: The abbreviation triggers a substitution only when you type it in the same case as the abbreviation. For example, “Ttx” won’t trigger the substitution for my “TextExpander” snippet; only “ttx” will.
  • Ignore Case: The abbreviation triggers a substitute regardless of the case in which you type it. Generally, this option reduces the possible uniqueness of the abbreviation, but can be useful in some cases, such as when you have to type an extended text passage in all-caps or are using software that automatically capitalizes the first character following a period and a space (such as on an iPad with TextExpander touch; see Use TextExpander touch).
  • Adapt to Case of Abbreviation: This option capitalizes the first letter of the snippet if you capitalize the first letter of the abbreviation when you type; it puts the first letter of the snippet in lowercase when you type the first letter of the abbreviation in lowercase. For example, “yyos” might produce “your obedient servant” while “Yyos” produces “Your obedient servant.”

Now that you know what makes a good abbreviation and how case sensitivity works, the act of creating an abbreviation is anticlimactic:

  1. In the TextExpander window, at the bottom right, click in the Abbreviation field and type your abbreviation.
  2. Optionally, above the Abbreviation field, choose a case-sensitivity option from the pop-up menu.

Label the Snippet

While abbreviations need to be short (so they’re easy to type), unique (so they don’t conflict), and unusual (so you don’t type them by accident), labels need to be informative: a label is what you call a snippet, so when you’re looking for the snippet (and, if you have a lot of them, sooner or later you will) you can tell from its label what it contains.

For short snippets, the label can be the snippet content itself. This sort of label is so common it’s the default: if you don’t give a snippet a label, its contents become the label. You can assign a custom label, however, by typing one in the Label field of the TextExpander window. The label appears not only in the Label field but also in the Groups list at the left, which lists your snippets groups and the snippets that each group contains (see Organize Your Snippets).

You can see examples of TextExpander labels in Figure 5, a few pages back: all the labels shown in the My Snippets group, except for the snippet currently being created, are custom labels.

Use the Snippet

Using a snippet is, as it should be, simplicity itself. If TextExpander is running (you can set it to run on login; see Manage Your Interfaces), you can type a snippet’s abbreviation in almost any program that accepts text input. As if by magic, TextExpander expands the abbreviation to the content that it represents.

It’s so easy, you may not even notice when it happens.

Learn the Types of Snippet Content

A snippet, as you’ve seen, is what TextExpander serves up whenever you type a snippet’s abbreviation. But plain text is only one of the types of snippet content. You can choose what kind of content a snippet can have from the pop-up menu above the TextExpander window’s snippet Content field, as shown in Figure 6.

**Figure 6:** Choose the snippet content type from the Content field’s pop-up menu.
Figure 6: Choose the snippet content type from the Content field’s pop-up menu.

The following is a brief rundown of the content types:

  • Plain Text: Exactly what the name implies—a plain text snippet contains Unicode text (so you can type in almost any language) with no style information attached. When TextExpander replaces an abbreviation with a snippet, a plain text snippet takes on the text format of the abbreviation that it replaces.
  • Formatted Text, Pictures: This type of snippet consists of Unicode text that has formatting information attached to it. The formatting information includes text size, color, font, font style, and text alignment. These snippets can also contain one or more graphical objects, such as a scanned signature, a logo, or a photo. They can even contain clickable Web links.

    When TextExpander replaces the abbreviation, the snippet appears as you formatted it in TextExpander, along with its graphical objects, if any. You can find out more in Add Formatting and Pictures, next chapter.

  • AppleScript: This kind of snippet contains an AppleScript. When TextExpander replaces the snippet, the AppleScript is run. AppleScript snippets are described later, in Script with Snippets.
  • Shell Script: This kind of snippet contains a shell script for one of the script interpreters supported by OS X. When TextExpander replaces the snippet, OS X executes the script. Shell script snippets are also covered in Script with Snippets.
  • JavaScript: You can write snippets in normal JavaScript, such as you might use on a Web page, to which a global TextExpander variable with some useful properties has been added. This kind of JavaScript works in both TextExpander on the Mac and TextExpander touch on iOS.

    You can also write snippets in Apple’s JavaScript for Automation, designed for automating OS X apps; this kind of JavaScript snippet works only in TextExpander on the Mac, not in iOS. See Script with Snippets for more about JavaScript snippets.

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

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