Page 1 of 1

Passing Hazel Tokens To Evernote via Applescript

PostPosted: Mon May 16, 2016 9:30 am
by jmvenable
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

Re: Passing Hazel Tokens To Evernote via Applescript

PostPosted: Mon May 16, 2016 10:39 am
by Mr_Noodle
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.

Re: Passing Hazel Tokens To Evernote via Applescript

PostPosted: Mon May 16, 2016 4:23 pm
by jmvenable
That's all there is to it? Just read the reference manual? Okay, thanks!!