Dictation via x-callback-url

In the Drafts documentation on x-callback-url, there is an option to dictate text and return the result.

/dictate
iOS macOS
Open Drafts dictation interface. Pass the resulting dictated text to the x-success URL instead of saving it in Drafts.

Using drafts5://x-callback-url/dictate as the x-callback-url, dictation works fine, and I can get the data back to the calling app, but the only way that I seem to be able to do this is to use the Create option on the dictation window. Pause just pauses with no return, and Cancel discards the dictation.

The thing about the Create option, is that it creates a new draft with the dictated content.

I think I must be missing something on using this. Can anyone point me to what I can do or select to return the dictated text without creating a new draft (or creating my own action to do it)? The documentation clearly notes that the dictation can be invoked with the URL in such a way that the text is only passed back “instead” of it being saved in Drafts.

1 Like

I’ll take a look. Sounds like a bug, it should not be saving the draft.

Great, but I’m still open to it being something I’m doing or not doing.

I like the idea of what you’re trying to do @sylumer.

I wonder if it can be done “headless” - so eg Pushcut Automation Server could initiate dictation this way. My guess is “no”.

What would be your trigger? If it is something local, probably no benefit over you triggering it yourself. If remote, you would need to know it is actively recording to utilise it, and you may not be around.

It would be Pushcuts Automation Server but two triggers for that:

  1. I might prefer Drafts/iOS dictation reliability etc to Mac’s. (Not sure I would.)
  2. On my Pi there is no dictation. So, I might remotely trigger a Shortcut to dictate and pull the text back to the Pi. (More likely than 1.)

I’d spotted it was the server. Pi scenario makes more sense, but would a push from your local device to the Pi be quicker/fewer interactions/fewer potential points of failure? I’m not sure, but it would at least remove the dependence on the Pushcut server I think.

1 Like

I agree, actually. “Architecture” is something I’m big on. And push versus pull is part of it.

Now back to the question you asked… :slight_smile:

OK, looked and there is a “save” parameter for the /dictate URL action that was not in the docs. Defaults to true, but if you pass save=false the result will be returned only in the callback and discarded in Drafts. Updated the docs accordingly.

Thanks, that works for me.

I’d suggest also making another change to the docs in the first paragraph for the dictate option:

Pass the resulting dictated text to the x-success URL instead of saving it in Drafts.

to

Pass the resulting dictated text to the x-success URL.

Since the default is to save it in Drafts, I think just removing the statement would help avoid confusion.

1 Like