Evernote Tag Checker Subroutine
Description
This subroutine will take the text value of a tag name (or a list of tag names) and process them so that they’re ready to be used in your AppleScript.
Here’s how it works — When you pass tags through this code (the variable is called “theTags” in my example), the handler checks to see if each tag already exists. If it already does, it adds it to the final tag list. If it doesn’t, it will first create it before adding it to a list.
The script then takes that final list of tags and formats it in a way that Evernote’s “assign” function can work with the data.
The Code
on Tag_Check(theTags)
tell application "Evernote"
set finalTags to {}
repeat with theTag in theTags
if (not (tag named theTag exists)) then
set makeTag to make tag with properties {name:theTag}
set end of finalTags to makeTag
else
set end of finalTags to tag theTag
end if
end repeat
end tell
end Tag_Check
Quick Links
Click here to open it in your Script Editor
Save this into Snippets
New To AppleScript?
- Here's how to use the AppleScripts you find here and -- to make them even easier to use -- here's how run them with simple keyboard shortcuts!
- Be sure to check out other great AppleScripts in the Veritrope.com Code Library -- and share your own AppleScript projects using the quick submission form!





No Comments / Add Yours!