Evernote - ZKN - Tag Autocompletion Macros (v9.0.5)

This macro enhances the tagging functionality of Evernote's native macOS client by providing a way to search for tags in an "unanchored" way, that is, if I have a tag "gotomuseum", I can find this tag when searching for "museum", whereas the native tag autocomplete would only find the tag, if I typed at least "gotom". This is helpful, when having lots of tags in a deeply nested tag hierarchy.

Introductury blog post: Evernote Tag Autocomplete Macro Version 2

Evernote - ZKN - Tag Collection Macro (v9.0.5)

Evernote - ZKN - Tag Collection.kmmacros (8.3 KB)

Evernote - ZKN - Tag Selection Macro (v9.0.5)

Evernote - ZKN - Tag Selection.kmmacros (4.5 KB)

2 Likes

Thank you @matti for sharing your macros.

Can I request you to help understand these two things? Appears that if all tags are in English and without accents etc, then this may not be needed.

  1. #!/bin/bash
    perl -MUnicode::Normalize -CSA -E 'say NFC( qq(@ARGV) )' "$KMVAR_Tags"

    Did a search on google for the Perl command but it seems like it will have to be a deep dive into Perl which I do not yet know.

  2. And this step.
    image

Thank you!

This is just a way to normalize the strings, since I had Problems when first trying to parse my list of tags as is. YMMV and maybe it's not needed in your case.

As to why I used perl here: I just tried to find a mostly platform independent way to normalize the strings. This is mostly a googled command slightly adapted to our use case here (I don't know how to use perl either).

We have a long list of tags of the form:

tag foo, tag bar, tag foobar, ...

We want to do something with every actual tag, so we use the slightly initmidating looking regular expression.

(the highlighted words will be captured, link to visualisation).

Next we want to do something for each match, but also with the match itself, therefore we have to match inside of every match again: .+

And then we would like to put all those tags just in a long list that will look like this:

foo
bar
foobar

So we append those captured strings to the variable TagsFound.

1 Like

Got it. The Debuggex website is a new one for me. Looks good.

Btw, I think you may be able to avoid getting the tag word into your variable if you use the following AppleScript. As it seems to me that you are getting rid of the "tag " portion using a regex. (Although I suspect you already know this.)

tell application "Evernote"
	set theTags to name of every tag
	return theTags
end tell
1 Like

I will have to give your suggestion I try, thanks!

1 Like