Macro to insert evernote notebook name into body

Since I have a gazillion evernote notes, I find it useful to always write the name of the notebook in the body below the title. It's very useful to retrace notes which are printed out.
It's so tedious to fish out the notebook name to copy paste it that I end up writing the sometimes long notebook name myself.
I would like to create a macro to somehow capture the notebook name and paste under the title. The last part is doable, but I have no idea how to capture the notebook name.
thanks very much

Easy enough. Just put this script in an Execute AppleScript action and set the results to a KM variablae, or System Clipboard, whichever you prefer.

NOTE: You must have one Note selected, or this will throw an error

tell application "Evernote"
  set noteList to selection
  set nbName to name of notebook of (get item 1 of noteList)
end tell -- Evernote

return nbName

If you're running KM9, be sure that take advantage of the need Execute AppleScript option to terminate Macro if the script gets an error:


1 Like

great ! thank you very much

Everything works perfectly ... thanks to you.

I am trying to become a bit less unsophisticated.

Is there a more sophisticated way using KBM actions (not the script) that I could have prepended ¨Notebook:¨ to the Notebook name which I copied to the clipboard, instead of using very basic techniques such as type keystroke, insert text by typing etc

thanks again

Please note that the heart emoji is simply a tag I use to classify my macro, nothing romantic.

Don’t tell me that @peternlewis forgot to implement a tag field for macros in KM9 :wink:

1 Like

I can't find the tag field. Using KBM 9


Good point. That’s because it is still hidden by default.

Hint: Take a screenshot of a macro and use Affinity Photo or Adobe Photoshop to make it appear :wink:

1 Like

very well done !!

@peternlewis, is there a KM hidden preference to show the Macro Tags field?
Assuming there is, how can we search for Macros using only tags?

1 Like

I think that Tom mentioned Photoshop

And Affinity Photo, which I prefer.

I don't have either of those apps, and KM should support showing the Tags field using Bash defaults command.

I support this. But a regular check box in the prefs would also be fine. Maybe with KM 9.2?

Oh yeah, it would be much better in the normal, UI KM Preferences. But Peter has a real aversion to them, for some unknown reason.

I propose to use the existing “t” qualifier (currently for ‘trigger’), and redefine the trigger qualifier as “tr”. And, tags should also be found in searches without qualifier. Just my thoughts.

That breaks existing muscle-memory. Why not just use ta for a TAG search?

I thought of this also. But I think tags will be a major search point, so giving the more simple “t” to tags seems reasonable. But I can also live with “ta”.

Anyway, I think @peternlewis will find a good solution (as he usually does), once he implements tags.

We can still complain later :wink: