How to recognize both notebook and title automatically when appending to Evernote?

Hey all,
I dictate most of my notes and and am trying to setup a system where my drafts are automatically categorized and appended to the appropriate note, in the appropriate notebook, in Evernote.
Currently I’m able to get Drafts to append to the note I want by dictating the note name, then “new paragraph”, and then the body of the draft. So my action is configured to append to the note [[title]].
Problem is, I’d like to append to lots of different notes in different notebooks. So how can I get Drafts to automatically recognize both the note and the notebook in my dictated text, and then send to Evernote accordingly?
I’m thinking maybe the notebook could be designated by a tag. If so, is there any way to get Drafts to automatically recognize a part of the text as a tag? Or is the only way to go in and manually add the tag?

Drafts has template tags that can produce specific lines in the draft, like [[line|1]], [[line|2]] (where [[line|1]] is the same thing as [[title]]). Details in the template tag reference.

The Evernote action step fields all support tags, so just as you are using [[title]] for the note title, you could use a tag in the notebook field.

So…if you configure your Evernote action like:

Note: [[line|1]]
Notebook: [[line|2]]

Not sure if you have another content in your “Template” for the step, but in this case you would use [[line|3..]] instead of [[body]] to get the remainder of the note in the content.

With that config, you could dictate “Note Title new line Notebook Name new line …”

Perfect :slight_smile: thank you!

So I created an action based on this and it works perfectly. And now I’m trying to setup a way to get that action run on all drafts in my workspace automatically. Based on searches in this forum it seems like the best (only?) way to do this is through shortcuts, something like this: Automatically send to Omnifocus
So I created the shortcut pasted below, when I run it Drafts shows me a green message as if the action was run correctly, but in practice the action hasn’t been run:

Any tips on how I need to change that shortcut to get it to run correctly?

Some shortcut actions play nicer with with looping than others. In particular, although it should work in some circumstances, shortcut actions which require an app to be launched (like “Run Action”) are not well suited to use repeating.

The most reliable way to do this would be to have an action in Drafts that loops over the workspace and queues the actions to run. That would look something like the below in a script action:

// load workspace and action by name
let workspace = Workspace.find("WORKSPACE-NAME");
let action = Action.find("MY-EVERNOTE-ACTION");

// loop over drafts in workspace inbox
let drafts = workspace.query("inbox");
for (let d of drafts) {
    app.queueAction(action, d);

Then you could run that in Drafts to have it process the whole workspace, and you could trigger it from Shortcuts with a single “Run Action”.

That said, this will not play nice with scheduled automation in Shortcuts, if that is your end goal, because it required the device to be unlocked and the app to launch. There’s not a reliable way to make this totally a background operation on iOS.

Works :slight_smile: thanks again