Append Evernote Notes

Use Scenario

I personally have several notes in my Evernote notebook that serve as collection points for various text items. For instance, I have one note for quotes. I have another for ideas. Yet another for product development. And so on.

On my phone, I use an app called "Drafts" that allows me to enter text and then tell the app to append this text to one of these pre-defined notes. But on my Mac, I always had to do it manually - i.e. open Evernote, open the correct note, scroll to the bottom, and then type or paste my text.

This script now does it automatically:

  1. It prompts for the text and lets me select one of several possible target notes.
  2. It uses AppleScript to activate Evernote, open the correct note, and append the text at the bottom.

One problem I had when putting it together was identifying the correct note. Most of the examples I found on the web had Evernote search for the right note using its title. But as soon as you have more than one note that matches a search for that title, such a script will fail. The solution I'm using now is that the notes are addressed using the unique hyperlink that Evernote assigns to each note.

To get the hyperlink of a note in Evernote, right click the note in the notes' list and select "Copy Note Link".

There are two versions of a note link that Evernote uses:

If you paste the link somewhere outside of Evernote, the link will point to an http:// URL. If you paste it inside an Evernote note, however, it will start with evernote:///. It is this latter version of the link that you'll need inside this script.

The evernote:/// link can be generated out of the http:// link by doing a regex search and replace:

Search https://www.evernote.com/shard/([^/])/nl/([^/])/([^/]*)/
Replace evernote:///view/$2/$1/$3/$1/$3/

The part of the script that you'll need to customize is the action "Custom Floating HTML Prompt: Milligram Default", and there the part after this line:

<select id="target" name="target">

Makes use of…

Download

Evernote - Append Notes.kmmacros (15.3 KB)

2 Likes

Nice! I had to download the Macro to understand that it's just a matter of populating the dropdown list with the Evernote Note Links and Titles (replacing the ones that are already there).

BTW, you can grab the local note link directly on EN for Mac by right clicking the note and pressing Option to reveal "Copy Classic Note Link".

Thanks!