Help using a Worklfow/Shortcut Result


#1

I have what might be a dumb question

I have a workflow/shortcut I want to send text too, have the workflow do it’s thing and then output is text.

Is there a way to return to drafts after the workflow runs and use that outputted text? Currently I have the workflow save the text on the clipboard and the drafts action grab the clipboard but it feels like there should be a better way I’m missing.


#2

If you use [[workflow_result]] that should give you what you want.

The Workflow action step documentation


#3

If you’re using x-callback urls you should be able to get the returned values as tags

e.g. in Ulysses (with URL) the URL is returned in a tag - in this case it copies to the clipboard afterwards but that is by design not necessity.


#4

Thank you rose. I used [[shortcut_result]] and that works perfectly. It’s just a simple shortcut that calls its auto corrrect block and then replaces the original content of the draft with the result


#5

Apparently everyone jumped in while I was putting together a longer response :laughing:

Just in case it does help, here’s what I had.


Here’s an example Drafts action and Workflow.

The workflow just wraps the content it is given with two lines of three hyphens.

The Drafts action calls the Workflow twice.

The first call is using the x-callback URL step where it then uses the callback based template tag to insert the text returned into the draft at the current cursor position.

The second call does the same, just using the preferred Workflow step. This returns the workflow based template tag and the insertion is as per the first round.

I included both in case you wanted to see how you might use it for something that isn’t Workflow of or Shortcuts which Drafts 5 has (/will have) steps for,

Note that Workflow returns the result in return as specified in the Workflow documentation. Drafts is then prefixing that with an action step identifier to make it available as a template both for callbacks and for workflows.


#6

Thanks. That is helpful so I appreciate you taking the time