Jump to content
9kids

Syncing Tags using Hazel

Recommended Posts

Hi all,

 

I'm using Hazel to move files from my Mac's hard drive into Evernote, using an Applescript to retain Notebook names.  Is it possible to retain the tags as well?

 

Here is the applescript I am using thus far:

 

tell application "Evernote"

activate

create note from file theFile notebook {"! Inbox"} tags {".education"}

end tell

 

However, what I would really like to do is have the tags that are currently attached to my files be transferred into Evernote automatically.  Is this possible?'

 

Thanks so much!

 

 

 

Share this post


Link to post

I have a similar kind of an issue, Instead of adding tags from OS X, I want the tag as year from document attributes "Creation date" using Hazel. The code I have written for Hazel is as below (** I am very new to apple scripting. below code is a copy and little modified version of what i found on internet)

 

tell application "Evernote"

activate

 

set the_date to item 1 of inputAttributes

 

set yr to text -4 thru -1 of ("0000" & (year of the_date))

 

create note from file theFile notebook {"INBOX"} tags {"TAG 1", "TAG 2", "TAG 3"}

assign tag yr to theFile

end tell

 

This code does create note in my INBOX folder, but only assigns tags "TAG 1", "TAG 3" and "TAG 3" . How can I add the year of document creation as tag. Any guidance will be really helpful.

Share this post


Link to post

I'm not sure, but I think the tag must already exist before you assign it to the Note.

Does your year tag already exist?

Share this post


Link to post

yes the year tag already exists and is been used by several other notes on my Evernote.. 

Share this post


Link to post

Then that points to the formula you have for creating the year tag.

Have you output it to make sure it is being done correctly?

Share this post


Link to post

I think I found the issue.  Instead of using 

assign tag yr to theFile

I should be using 

assign tag yr to note1 (which is the name of my note created in evernote)

 

The modified script is as below:

 

tell application "Evernote"

activate

 

set the_date to item 1 of inputAttributes

 

set yr to text -4 thru -1 of ("0000" & (year of the_date))

 

set note1 to create note from file theFile notebook {"INBOX"} tags {"TAG 1", "TAG 2", "TAG 3"}

assign tag yr to note1

end tell

 

Thanks for your help. one last off topic  request, can you help me with a good source for learning apple scripting?

 

Thanks again for the help.

Share this post


Link to post

Thanks for your help. one last off topic  request, can you help me with a good source for learning apple scripting?

 

Thanks again for the help.

 

I've got a lot of Applescript references in Evernote, but I need to compile them for outside consumption.

When done, I'll make a new thread that we all can use as a reference and sharing.

 

Meanwhile, this should get you started:

If you really want to get into Applescript, then I highly recommend this book:
 
I have the Kindle addition and it works great.  I read it on my Mac Kindle app, and as I find something to note or use, I just copy it from Kindle to Evernote.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...