Jump to content
  • 0

Syncing Tags using Hazel


9kids

Idea

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!

 

 

 

Link to comment

7 replies to this idea

Recommended Posts

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.

Link to comment

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.

Link to comment
  • Level 5*

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.
Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...