TextExpander
 

Help: Creating Snippets

Three Steps to Creating a Basic Snippet

  1. Click on New Snippet new snippet button in the toolbar or choose File > New Snippet from the menu.
  2. Add the snippet content in the snippet editor on the right.
  3. Assign an abbreviation in the "Abbreviation" box below the content.

    Optional: Add a label for your snippet in the "Label" box, (see below). This is a chance to have a longer more informative description of the snippet than the abbreviation allows. Helpful if you are sharing your snippets with a team.

Note: On Mac you can also create new snippets from selected text or from the Clipboard contents. (See below).

If you have TextExpander hidden in the Dock (see Preferences: Appearance), create snippets using the TextExpander menu bar item or a hotkey shortcut.

What Makes a Good Abbreviation

A good abbreviation is:

  • short
  • easy to remember
  • unlikely to be typed by accident
  • unique

Duplicating an abbreviation's first character (ddate, ssig, zzip) is one way of creating abbreviations that meet these critieria. Another way is to use a period or other punctuation mark as the first character of your abbreviation (;date, 'sig, /zip).

Abbreviations for Teams

When sharing groups with a team of people, having a logical abbreviation naming scheme can help everyone remember the abbreviations. For example, a snippet group with answers to customer questions on billing may start with the same prefix (bill.refund, bill.total) and a different prefix is used for a group with answers to sales questions (sales.quote, sales.thx).

Conflicting Abbreviations

If abbreviations are too similar, they will conflict. For example, if there are two snippets with the same abbreviation and different content, TextExpander won't know which content to expand, and will expand the first one found.

A small conflict indicator Conflict Indicator or duplicate indicator Duplicate Indicator will appear at the bottom of the snippet list, and the abbreviation of the snippet will be highlighted in orange in the snippet list, or in blue if the snippet is an exact duplicate of another.

Conflicting abbreviations may not expand as desired, as the conflicting snippet may expand instead. (Duplicate snippets do not cause problems.)

If the conflict or duplicate indicator appears, edit the abbreviation of the snippet you are creating so it is unique, and the indicator will disappear. Or, click the indicator to display a window showing the conflicting snippet or snippets. There you can resolve the problem by deleting the abbreviation of the other snippet, deleting the other snippet entirely, or editing the other snippet.

Format

Snippet content has several format options:

  • Plain Text
    When expanded, the snippet content conforms to the current text style. This is the standard snippet format, it works best for autocorrection and any other snippets where you want them to fit in with the format of the surrounding text. This can work with the macros listed below, but not with images.
  • Formatted Text, Pictures
    Color, size, font and alignment can be specified for text and maintained upon expansion. Good for email signatures and graphics, this format can include hyperlinks.
  • AppleScript (advanced)
    The snippet content can be an AppleScript, which is triggered by the abbreviation. (See Script Snippets)
  • Shell Script (advanced)
    The snippet content can be a shell script, which is triggered by the abbreviation. (See Script Snippets)
  • JavaScript (advanced)
    The snippet content can be a JavaScript or JavaScript for Automation (JSA), which is triggered by the abbreviation. (See Script Snippets)

To set a snippet's content format, click on the Content drop down menu above the snippet editor.

Using Formatted Text in Snippets

  1. Set the content format to Formatted Text, Pictures.
  2. Add snippet content in the snippet editor.
  3. Select some text to be formatted and use the editing bar font options for fonts, size, color, and alignment.

Note: Not all fonts have all typeface options. For example, if you want italics you will need to find a font that offers italics as an option.

Adding Images to Snippets

  1. Set the content format to Formatted Text, Pictures.
  2. Click the Add Image button in the HTML editing options. A file dialog will open allowing you to locate a picture file on your hard drive.
  3. To remove an image, use the Delete key.

The default content format is set in TextExpander > Preferences under the Expansion tab.

Adding Hyperlinks to Snippets

  1. Set the content format to Formatted Text, Pictures.
  2. Select the text, or image, you would like to be the link.
  3. Click the Make Link button at the top of the snippet editor and then enter the URL for the website.
  4. Click OK.

You will see the URL in blue and underlined.

Adding Macros to Snippets

TextExpander includes some advanced code features called macros which you can insert into your snippets. Insert macros using the various buttons at the top of the snippet editor in the editing bar.

editing bar

These include:

  • Date
    Inserts the day, month and year of the current date in a variety of formats. (See Date, Time, and Math Macros).
  • Time
    Inserts the current time in hours, minutes, seconds and AM/PM. (See Date, Time, and Math Macros).
  • Date/Time Math
    Inserts a date or time that takes the current date/time and adds to or subtracts from it; e.g. five days from today. (See Date, Time, and Math Macros).
  • Enter, Escape, Return, and Tab key presses
    Inserts a replication of a physical key press for Enter, Esc, Return or Tab; useful for web forms.
  • Clipboard
    Inserts whatever you just copied on the Clipboard (Cmd+C on Mac, Ctrl+C on Windows) into your snippet when expanded.
  • Insert Snippet
    Nest, or reference, another snippet within your snippet. For example, you might want to use your telephone number snippet in your email signature snippet. If your telephone number changes, you need only update one snippet.
  • Cursor
    • Use Position Cursor Here to specify where you want the cursor to appear within your snippet text after the snippet is expanded. For example, if your snippet is a full letter or email, you might want the cursor to appear at the top so you can personalize the salutation without having to click around with your mouse. This lends itself to quick customizations of “Dear Jane,” instead of boilerplate “Dear Sir/Ma'am”.
    • In cases where your editor might automatically add indenting to your snippet, or for other reasons, you can specify up, down, left and right arrow movements.
    • Keep or abandon delimiter allows you to override the delimiter behavior specified in Preferences: Expand Abbreviations on a per snippet basis.
  • Fill-in
    Place fill-in-the-blank fields in your snippets which can be filled in while expanding the snippet; useful for form letters. For example, "Dear ____, Thank you for the ____." Other field options include popup menus and optional text sections. (See Creating and Using Fill-in Fields).
  • Picture
    Browse for an image to insert. The content menu of the snippet must be set to “Formatted Text, Picture.” Images can also be made into hyperlinks. (See Adding Images to Snippets).
  • Hyperlinks
    Create URL links out of words or images in your snippet. The snippet Content must be set to Formatted Text, Picture. (See Adding Hyperlinks to Snippets).

For more information on Date, Time, and Date/Time Math, see Date, Time, and Math Macros. For more information on Snippet, Key, Clipboard, and Cursor, see Advanced Snippet Functions: Macros. For more information on Fill-ins, see Creating and Using Fill-in Fields.

Labeling Snippets

By default, a snippet's label is a shortened version of the snippet contents. You can specify a short, more useful label to appear in the snippet list instead. Enter the label in the Label field below the snippet editor.

Preview Expanded Snippet

Preview a snippet's expanded state in the TextExpander window by clicking the Preview (eye) button next to the Label field, or type Command + Return (Mac) key. Particularly useful when creating date or time snippets, or snippets with other macros. (See Advanced Snippet Functions: Macros).

Setting Case Sensitivity

TextExpander abbreviations can be case sensitive. There are three options:

  • Case Sensitive (aB, Ab, ab, AB differ)
    Example: "YT" expands to "Yours Truly", "yt" does not.
  • Ignore Case (aB, Ab, ab, AB same)
    Example: either "YT" or "yt" expands to "Yours Truly"
  • Adapt Snippet to Case of Abbreviation
    Example: "Yt" expands to "Yours truly", "yt" expands to "yours truly"

A default case sensitivity is set in TextExpander > Preferences under the Expansion tab. (See Preferences.) You can switch the case sensitivity setting on individual snippets by clicking the drop-down at the bottom of the snippet editor, near the Abbreviation box.

Create Snippet from Selection or Clipboard (Mac Only)

A quick way to add snippets to your collection is to create new snippets based on a text selection or on the Clipboard contents. If you've just typed something and realize that it would be a useful snippet for future use, follow these steps:

  1. Select the text you want for the snippet content.
  2. Click the TextExpander menu bar item
  3. Click Create Snippet from Selection... (or Create Snippet from Clipboard... if you have copied the text to the Clipboard.)

The Create Snippet window opens with your selection (or the Clipboard contents) already entered in the Content field. Assign an abbreviation and a snippet group and click Create.

You can also access Create Snippet from Selection or Create Snippet from Clipboard via hotkey.

Edit last expanded snippet

You can easily edit snippets as you are using them. If you expand a snippet and realize that it needs to be revised, say you need your new phone number in your signature, try this:

  1. Click the TextExpander icon in the menu bar (Mac), or system tray (Windows).
  2. Click Edit Last Expanded Snippet.
  3. Make your revisions.

You can also access Edit Last Expanded Snippet via hotkey.

Suggest Snippets

TextExpander can suggest new snippets based on what you type. After you have typed the same group of characters, letters or words enough times, it will suggest you create a snippet. All the snippet suggestions are collected in a Suggested Snippets group where they remain without abbreviations. You may choose to ignore them, add an abbreviation to complete them, or delete them.

Privacy Details

TextExpander observes your keystrokes, as well as the contents of the pasteboard when you Paste using ⌘V.

TextExpander will track how many times you repeat the same group of characters and create a new suggestion after a certain amount of repetition. However, it does not save the tracking of what you type so the tracking is lost with each TextExpander restart. Therefore, frequent restarting of TextExpander won't result in many suggestions. None of what you type is saved by TextExpander except for the snippets listed in the Suggested snippets group.

“Tracking” does not mean TextExpander keeps a list of the actual characters you type. Instead, it keeps an encoded record (called a “hash”) of that group of characters, similar to the way a password is securely stored so that no one reading it knows what it is. You might type “yourpetsname” but what TextExpander sees and records is “1739405847385.”

Notifications

Once a word or phrase is typed often enough, TextExpander will inform you about this new snippet using Notification Center. From there you can choose:

  • Keep Suggestion: Assign the suggested snippet an abbreviation.
  • Drop Suggestion: Never recommend this group of characters as a snippet again.

(See Preferences > Suggestions).

Deleting a Snippet

  1. Select the snippet in the Snippet list on the left side of the TextExpander main window.
  2. Click on Delete delete button in the toolbar, or use the Delete key on your keyboard.

 

 

Smile logo

© 2006-2019 SmileOnMyMac, LLC, dba Smile. All rights reserved.
TextExpander is a registered trademark, Smile and the Smile logo are trademarks of SmileOnMyMac, LLC, dba Smile.