Creating new TextExpander snippets with Workflow from (almost) any app

Using Workflow, you can create TextExpander snippets in nearly any app.

Snippets in TextExpander can save a lot of time typing

When you have a lot of repetitive typing to do, text expansion can be a real timesaver. iOS has built-in keyboard shortcuts, which can a big help for things you type often such as an email address or phone number however, these text shortcuts are rather basic. Though limited by Apple’s app sand boxing, a real text expansion app can typically go a lot further, and the best in this market is TextExpander by Smile Software. TextExpander can save you a lot of time, especially if you’re using apps that support it, and provides an SDK that has been adopted by several great writing apps, such as Drafts and Day One. There is a good number of apps that have added support for TextExpander, but they also provide a third-party keyboard to expand snippets. I do find I have some personal issues with the keyboard, and I’ve heard criticisms from others, but I still find it useful especially compared to the other options.

Though perhaps less known, TextExpander also provides a URL scheme. Sometimes, when I’m writing something for the x-teenth time, I think, I should really make that a snippet. I’ll do it when I’m finished here, and then I forget by the time I’m done. On the Mac, it’s really easy to create a snippet. On iOS you have to open the app and fill out the new snippet form. Luckily there is another way: the URL scheme.

TextExpander’s URL scheme offers a method for creating new snippets. All we need is a way to launch that URL while passing our intended snippet content to it as input, right from the very place we are typing. That’s where Workflow comes in. Though it has no support for TextExpander built-in, it does make it easy to take text input and run a URL scheme with it. However, I wanted a bit more control here. TextExpander provides a system of organization for snippets in the form of groups. I wanted to be able to select a destination group for the snippet when I create it, and set an abbreviation for it. That’s what the final workflow does.

This workflow creates a snippet from the selected text

To use the workflow, simply select the text you wish to save as a snippet. In the Copy/Paste pop up menu, there is also a Share option. Tapping Share from here will share the text only, which is what we want. Then select the Run Workflow action extension and choose the Create Snippet workflow. The workflow will first display the selected text so you can edit if needed and then confirm it. Next it will ask you to create an abbreviation for your snippet, and then show a list of groups from which you can select as a destination for the snippet. The workflow will then launch the Workflow app and prompt you to confirm you want to open TextExpander. Once it does, the new snippet is created and you are returned to Workflow. Unfortunately, due to Apple’s restrictions in iOS, the extension must first open Workflow to launch the URL scheme, and it is not capable of returning you to the original all you started in. For me, that’s a small annoyance but certainly not a deal breaker.

The workflow lets you select a group and apply an abbreviation

You should customize the workflow by changing the group names in the List action to reflect your actual snippet group names. Be sure to match spelling properly with how they appear in TextExpander. You can grab the workflow here. Let me know if you have any questions or suggestions.

Leave a Reply

Your email address will not be published. Required fields are marked *