Triggering an Action via typed string (Built-in text expansion)

tl;dr - Can the Keyboard Shortcut for Actions be extended to allow for strings of typed text as the trigger? Native text expansions harnessing the Actions scripting environment would be a compelling Pro feature.

Pitch

In line with Drafts’ mission to be the fastest/easiest way to capture and act on your text, I think that the ability to trigger Actions by typing an abbreviated ‘shortcut’ string would make both text input and text processing even more seamless. As a pro feature this would also help a D5 subscription to become a complete text editing environment that would reduce dependency on other apps/services (namely Editorial and TextExpander), and as an integrated solution it would probably surpass them anyway.

Current situation

At present the easiest way to trigger actions while typing (via the on-screen keyboard) is by including them an ‘extended keyboard’. D5 has widened this power by integrating the full Actions architecture into each ‘key’ of what can now be several different extended keyboards, but the number of actions that can be accessed this way is still limited by screen size and the need to manually switch between (or scroll) layouts.

Drafts has had the ability to assign keyboard shortcuts to Actions for a while, but only for hardware keyboards (and these are for single-key triggers only).

Proposal & Benefits

If an abbreviation could be assigned to an Action so that it was triggered when typed (on either on-screen or hardware keyboards), then a far greater number of Actions could be accessible seamlessly within the act of inputting text. This would have all the usual benefits of existing text expansion apps on iOS/macOS (no context-switching, no cluttering of the UI, mnemonics to aid recall, etc.) with the addition of some extra Drafts-specfic benefits:

  • Allow text expansions to call upon Drafts’ integrated JS scripting environment, enabling powers that go far beyond what is currently possible on iOS with TextExpander’s JavaScript support.
  • Interactive snippets involving e.g. the new Prompt UI for placeholder support, other Action steps/variables à la Editorial’s workflow scripting.
  • For users who currently have lots of actions, abbreviation-triggered Actions to insert/modify text would also free up space on extended keyboards to focus on Actions which operate on selected text or on higher level app objects (since typed abbreviations would not be suitable for these).

Wider scope

There is potential for deepening the integration of this feature in the long run (See Keyboard Maestro’s Typed String triggers and what its users are getting up to as a result). In the future it would also be great if the UI could suggest completions for matching abbreviations in the way that Editorial does (though a modification of the existing code for hardware keyboard shortcuts may be all that is necessary to get this started). You may not want to take Drafts in the direction of a code editor, but with the JavaScript and HTML syntaxes already available (with more on the way) the addition of text expansion could make coding in Drafts more compelling.

I understand you may also not want to go head to head with TextExpander, but this feature may also help sway those who are currently on the fence over taking on another app subscription: For me (and anyone else who writes everything possible in Drafts, doesn’t require team collaboration etc.) it would render a TextExpander subscription unnecessary.

Thanks again - for Drafts, and for giving us the chance to get involved,

Mark

4 Likes

Great idea. I, for one, would pay for this. Having the ability to decide keyboard shortcuts would be a plus.

Upvote from me. I’m just on the edge of needing a Textexpander subscription (currently do). I would love to be able to build my own equivalent functionality with scripting. It would be even better to be able to trigger any Drafts action with a character sequence.

2 Likes

A big +1 for this feature. I stopped paying for TextExpander subscription as there have been no useful features added in the past two years or so. I currently use Typinator or Mac and it is great but I would like to try to use my iPad for client intake forms. Text expansions are essential for form reports.

The moment Drafts will support these two features, I will become a subscriber:

  1. A quick way to trigger user input prompts.
  2. A default option to focus on OK button for prompts to just press the Enter key on the keyboard after entering text.

For #1, you can set actions to have an external keyboard shortcut or you can trigger from a button on the extra keyboard row.

For #2, there was something in beta 5.2.3.8 for prompts that might meet the underlying need for this one once it makes it into a public release.

What specifically do you mean keyboard shortcuts? SOmething like CMD+Option+J

I have over 50 abbreviations that I need to expand into actions with prompts and text fill-in.

I don’t know if this helps you, but I’ve been experimenting with a Shortcut replacement action

1 Like

Yes.