TextExpander logo TextExpander SmileOnMyMac logo
 

Help: Creating Snippets

Three Steps to Creating a Basic Snippet

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

Note: You can also create new snippets from selected text or from the Clipboard contents. For more details, see below.

If you have TextExpander hidden in the Dock (see Preferences: Appearance), you will need to access the snippet creation menus via the TextExpander menu bar item or via predefined hotkey shortcuts.

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.

If abbreviations conflict, they are highlighted in orange. Conflicting abbreviations cannot trigger expansions.

Format

Snippet content has four format options:

  • Plain Text
    When expanded, the snippet content conforms to the current text style.
  • Formatted Text, Pictures
    Color, size, font and alignment can be specified for text. Images can be used.
  • AppleScript (advanced)
    The snippet content can be an AppleScript, which is triggered by the abbreviation.
  • Shell Script (advanced)
    The snippet content can be a shell script, which is triggered by the abbreviation.

To set content format, click on the drop down menu at the top of the Content box.

Using Formatted Text in Snippets

  1. Set the content format to Formatted Text, Pictures.
  2. Add snippet content in the Content box.
  3. Select text to be formatted.
  4. Click on the text format button button below the Content window to access Font and Text options for fonts, size, color, and alignment.

Adding Images to Snippets

  1. Set the content format to Formatted Text, Pictures.
  2. Drag your image into the Content box or copy it to the Clipboard and use Command + V to paste it into TextExpander.
  3. To remove an image, use the Delete key.

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

Adding Macros to Snippets

Insert predefined macros to snippets via the insert button plus button below the Content box. Predefined macros include:

  • Date
    Inserts the day, month and year of the current date in a variety of formats
  • Time
    Inserts the current time in hours, minutes, seconds and AM/PM.
  • 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.
  • Snippet
    Nest a 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.
  • Key (new!)
    Inserts a key press for Enter, Esc, Return or Tab; useful for web forms.
  • Fill-in (new!)
    Inserts custom fields into your snippets that can be filled in while expanding the snippet; useful for form letters, e.g. "Dear ____, Thank you for the ____."
  • Clipboard
    Inserts whatever is on the Clipboard into your snippet when expanded.
  • Picture...
    Browse for an image to insert. Images can also be dragged directly into the content box or pasted from the Clipboard.
  • Cursor
    Specify where you want the cursor to appear after the snippet is expanded. TextExpander repositions the cursor automatically.

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 Content Box.

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 change the case sensitivity setting on individual snippets by clicking the drop-down menu bar above the Abbreviation box.

Create Snippet from Selection or Clipboard

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 (new!)

You can easily edit snippets as you are using them. If you expand a snippet and realize that it needs to be revised (e.g. new phone number in your signature, new product name in your boilerplate), try this:

  1. Click the TextExpander menu bar item
  2. Click Edit Last Expanded Snippet.
  3. Make your revisions in the Edit Snippet window and click Save.

You can also access Edit Last Expanded Snippet via hotkey.

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 in the toolbar, or use the Delete key on your keyboard.

 

 
 
© 2006-2010 SmileOnMyMac, LLC. All rights reserved.
SmileOnMyMac and TextExpander are trademarks of SmileOnMyMac, LLC.