Looking for help with reformatting merged evernote notes

Hey all. First time poster, long-time reader here.

One of my biggest issues is Evernote formatting, specifically when merging notes. Here's the basic setup:

  • I send text highlights from Instapaper directly to Evernote, but it’s often more than one per article.
  • I then select the notes, and merge them.
  • Problem is that the result from Evernote looks horrible (it’s far from plain text), and is full of duplicate links and headlines.

For example, simply merging several notes gives you this:

and stripping formatting looks like. And unfortunately each URL is different, because instapaper sends them with all sorts of cruft:

It's hardly ideal. Basically, end game would be a way to:

  • strip out all the headlines
  • strip out all the URLs
  • leave the note as close to plain text as possible.

I've looked into some regex and applescripts, but have come up empty (and I'm not super familiar with regex). Any ideas?

Hi atmtn,

Since you didn't post related source code or raw file, folks here hard to provide help to you. Despite this, your task isn't very suitable to be accomplished via Keyboard Maestro built in function.

Thanks for the response. Have seen some pretty powerful applescript and regex approaches, so not giving up hope entirely. I'm able to get part of the way with manually merging. And then the following macro effectively cleans up the text, but still stuck with too many URLs and headlines.

evernoteclean.kmmacros (4.3 KB)

Have been trying to use gruber's regex for matching urls https://daringfireball.net/2010/07/improved_regex_for_matching_urls to match and replace, but I keep getting "failed to match" errors

Whoa, think I may have actually gotten something that works. It's clunky, but:

  1. strips all urls out
  2. strips all duplicate headlines out
  3. reformats text at evernote standard (helvetica neue, 14) -- for some reason, it was reverting to times new roman near the end.

evernote merge clean.kmmacros (10.2 KB)