TextExpander touch 3.5 Adds Create, Expand x-callback-url Support

Philip Blog, TextExpander

Primarily of interest to other iOS app developers, in TextExpander touch 3.5 we've added create and expand commands to our x-callback-url support to allow other applications to work with TextExpander touch as part of a workflow.

Both of the new commands use the existing tetouch-xc URL callback scheme and standard x-callback-url conventions. To learn more about x-callback-urls in general, please visit x-callback-url.com.

If you'd like to play with these calls before implementing them in your app, we recommend you download and build the XCallbackURL app. Screenshots for trying each call appear at the bottom of this post.

Create

The create command allows third-party applications to create new snippets.
Command name = “create”

Parameters:

  • “abbr” – Abbreviation for snippet
  • “snippet” – Text to expand for snippet
  • “group” – (optional) Name of group to add the snippet to. Group must exist and be writeable. When not specified, the first writeable group is used.

Result:
x-success, no parameters, if created
x-error with error-Code, errorMessage, errorDomain (tctouch-xc-error) if notExample:

tetouch-xc://x-callback-url/create?
   x-success=sourceapp://x-callback-url/created&
   x-error=sourceapp://x-callback-url/creationError&
   abbr=lgl&
   snippet=Let’s get lunch!&
   group=MyFavoriteSnippets

(Note: callback URLs in parameters should be encoded. They were left decoded for legibility).

Expand

The expand command allows for expansion of an abbreviation. Command name = “expand”

Parameters:

  • “abbr” – Abbreviation to expand
  • “fillin” – (optional) Whether a fill-in snippet should prompt the user. Pass 0 to get back just the raw snippet. Default is 1 (user will fill-in)

Result:
x-success, expanded text in “expansion” parameter if expanded successfully
x-error, error-Code, errorMessage, errorDomain (tctouch-xc-error) if notExample:

tetouch-xc://x-callback-url/expand?
   x-success=sourceapp://x-callback-url/expanded&
   x-error=sourceapp://x-callback-url/expansionError&
   abbr=tyvm

(Note: callback URLs in parameters should be encoded. They were left decoded for legibility).x-callback-url create example    x-callback-url expand example