Typinator automation and regex

Hi everyone,

I just started using Typinator and wanted your help for the following set of questions since I couldn’t find answers to them online:

  1. How do I programmatically add snippets to Typinator? My use case is, instead of triggering the Create new item from Selection via a keyboard shortcut, how do I use AppleScript or any other scripting to trigger that feature so the Typinator popups opens up. I usually can’t remember shortcuts that well and would be using Alfred’s Universal Actions to add a new snippet to Typinator.

  2. How do I move snippets into Typinator programmatically?. E.g. I want to keep my iOS text replacement snippets and a specific Typinator snippet collection in sync. Until now I was doing that with Alfred where I would pull snippets from the SQLite db (plist format) and push that into Alfred (Alfred snippets are json files). How do I accomplish that?

  3. Another thing i’m struggling with is capturing the actual input/trigger. e.g., the inline calculation snippet has FORMULA=\? as the trigger and expands to {{#$1}} which is the result of the calculation. But this removes the actual calculation. I want 2+3=5 instead of just 5. How do I achieve that? I tried {{FORMULA}}={{#$1}} but this doesn’t work. Somehow I need to capture the input given to this macro

1 Like

Take a look at the Typinator library in Script Editor. You’ll see there:

create from selection v : Create a new item with the contents of the current selection.

There is also an entry for create from clipboard.

Stephen

Thanks for responding.

How do I do this? I opened Script Editor but don’t see anything Typinator related.

Go to the Script Editor Window menu, click on Library and add Typinator to the library if not already there.

Stephen

2 Likes