Passing Hazel Tokens To Evernote via Applescript

Get help. Get answers. Let others lend you a hand.

Moderator: Mr_Noodle

The only script I've found to upload files to Evernote is this one:

tell application "Evernote"
activate
create note from file theFile notebook {"Statements"} tags {"Power", "Lake", "Statement"}
end tell

I can neither find nor create script that will successfully carry DYNAMIC tags into Evernote. The tags above - "Power, Lake", and "Statement" - are all literals. I want to pass a variable (dynamic tag) that is computed in and passed by Hazel. Specifically, I want the year of the file as a tag. That's one example.

I know about the companion windows that allow the Hazel user to name variables that are either exported from or imported to the Applescript saved in a rule. But how to use those variables in a script? What is the syntax to pass a tag whose value is computed in Hazel? Or better yet, does anyone care to share a fully baked script that they've created to solve this issue?

As always, any help appreciated. JV
jmvenable
 
Posts: 22
Joined: Thu Apr 28, 2016 2:04 pm

Search the help for "AppleScript" for the full details but the attributes are sent in as an array/list. You can access them in the same order that you specified in the UI.
Mr_Noodle
Site Admin
 
Posts: 11951
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

That's all there is to it? Just read the reference manual? Okay, thanks!!
jmvenable
 
Posts: 22
Joined: Thu Apr 28, 2016 2:04 pm


Return to Support