Jump to content

Using Hazel move file to a specific Evernote notebook


Recommended Posts

I currently have a simple embedded AppleScript in Hazel to move a select PDF file to a new Evernote note (below). How would I go about adding the file to a specific notebook? Currently the new note is sent my default folder "@Inbox".

 

 

tell application "Evernote"

activate

create note from file theFile

end tell

 

Thanks in advance

Link to comment
  • 2 months later...

Hello.

 

I tried the simplest form of this script in Hazel (the one that goes to the default notebook), and it wouldn't compile. Attached is what I got.

 

Any ideas? I am on the latest version of Mountain Lion, Hazel, Evernote.

 

Thanks!

post-42998-0-44561900-1378997807_thumb.p

Link to comment
  • 2 weeks later...
  • 2 months later...

I've been using this script for quite some time with no issues:

 

 

tell application "Evernote"

     activate

     create note from file theFile notebook {"Notebook_Name"} tags {"Tag_Name"}

end tell

 

 

Lew

Link to comment

Hello.

 

I tried the simplest form of this script in Hazel (the one that goes to the default notebook), and it wouldn't compile. Attached is what I got.

 

Any ideas? I am on the latest version of Mountain Lion, Hazel, Evernote.

 

Thanks!

Hi,

 

Not sure if you managed to sort out your issue, but another way around this is to change tell application "Evernote" to tell application id "com.evernote.evernote".

 

That should fix it.

Link to comment

Lew

 

How do you add multiple tags to your script? Should the all be listed between " " with spaces or commas?

 

I would use the following script for multiple tags:

 

 

tell application "Evernote"

     activate

     create note from file theFile notebook {"Notebook_Name"} tags {"Tag_Name1”, "Tag_Name2”, "Tag_Name3”, "Tag_Name4”}

end tell

 

 

Lew

Link to comment
  • 7 months later...

Can somebody please tell me how to set a reminder within this code here

tell application "Evernote"activatecreate note from file theFile notebook "Notebook Name"end tell

I need a reminder for "two days from today".

 

Thank you very much!

Link to comment
  • 4 weeks later...

Hi everyone, I am brand new to this forum and had a question regarding creating a Hazel rule that would send the file to Evernote and add it to a specific NOTEBOOK Stack.

 

I found this specific question on the Noodlesofts forum but without any answers.

 

"- How do you specify a notebook stack in Evernote and the Syntax to specify a specific notebook within the the notebook stack?"

 

http://www.noodlesoft.com/forums/viewtopic.php?f=4&t=3449

 

I currently use the following applescript within hazel to send it to the general NOTEBOOK with tags and this works fine.  Would love to know how to edit this script so that it will be sent to a specific NOTEBOOK STACK.  

 

tell application "Evernote"

activate

create note from file theFile notebook {"Notebook Name"} tags {"tag1", "tag 2", "tag 3", "tag 4"}

end tell

Link to comment
  • 3 months later...
  • 5 months later...

I've been using a Hazel evernote script for a long time now. Suddenly last week I noticed it is no longer adding tags to documents it's adding to Evernote. It is putting them in the right folder but not assigning tags even though they are correct. Any idea what has caused this to stop happening. The script I'm using is of the form:

 
tell application "Evernote"
  activate
  create note from file theFile notebook {"Notebook Name"} tags {"tag1", "tag 2", "tag 3", "tag 4"}
end tell
Link to comment
  • 3 weeks later...

Hope this helps...

 

1)  You can remove 'activate' from the script.  If you do it will run the script in the background without grabbing Evernote's focus every time it runs.

2)  dgold - I also had issues adding tags until I manually created the tags in evernote first.  After that the tagging worked perfectly.

Link to comment
  • 2 weeks later...

@dgold105 -  I've experienced the symptoms of 'empty' tags recently but the note does go to the correct folders set in script.  I'm not exactly sure what the cause maybe but have observed it on more than a handful of occasions recently.  I just wanted to chime in and report that I'm a witness to this occurrence.  I'll continue to monitor it and update forum as necessary.

Link to comment
  • 9 months later...

My goal - use Hazel to move pdf to amex notebook in EN.

I am getting an error when copy and pasting these exact scripts. Screen shots attached.

Error reads: The variable theFile is not defined.

EN is open. Notebook matches EN exactly. 

Any help is appreciated!

 

 

 

 

Screenshot 2016-03-26 13.40.48.png

Screenshot 2016-03-26 13.39.47.png

Link to comment
  • Level 5*
53 minutes ago, McGilligan said:

My goal - use Hazel to move pdf to amex notebook in EN.

I am getting an error when copy and pasting these exact scripts. Screen shots attached.

Error reads: The variable theFile is not defined.

EN is open. Notebook matches EN exactly. 

Any help is appreciated!

 

Is this display from executing Hazel or from executing Script Editor?

In Hazel, variable theFile is defined by Hazel and the filename is passed to the script.

If you're running outside of Hazel, you need to define the variable.

For example, set theFile to xxx

Instead of Hazel, I use the built in Folder Actions.  My script looks like this

on adding folder items to this_folder after receiving new_Files
     delay 5
     repeat with 
from 1 to number of items in new_Files
          set new_File to item of new_Files
          Process_File(new_File)
     end repeat
end 
adding folder items to

 

 

Link to comment
  • Level 5*
1 minute ago, McGilligan said:

@DTLow ah. It's executing from  script editor which I have referenced in Hazel. After embedding the script in Hazel it works as expected.

which is better to run inside or outside of Hazel?

If you run outside of Hazel, you have to supply the filename 

Example:    Set theFile to xxxxxxxxxxxxxxx

Link to comment
  • Level 5*
9 minutes ago, McGilligan said:

@DTLow ok - so unless the file name will be the same I need to run inside Hazel. I have Hazel renaming the file name with current date on the front end.

For me, it's Folder Actions

Applescript can be coded to rename or delete files

For example: tell application "Finder" to delete new_File

                set the name of file "Monterey" to "Eden"
 

Link to comment
  • 1 year later...
On 3/26/2016 at 1:09 PM, McGilligan said:

@DTLow ah. It's executing from  script editor which I have referenced in Hazel. After embedding the script in Hazel it works as expected.

which is better to run inside or outside of Hazel?

I am trying to do a similar thing, i.e. have PDF files gathered in Zotero, saved in a dropbox folder, and sent to a notebook in EN. 

How and what exactly did you embed into the Hazel script? I have selected Run Shell Script and entered the code referenced above, but it will not work. 

I have tried running it through AppleScript, but experienced the same problem regarding theFile being "undefined." I changed the file name in AppleScript to correspond with the folder, but I only get a .zip of the file itself placed into the EN notebook. 

I basically want PDF files to be sent to EN each time a new one is downloaded and saved to the folder.  

Link to comment
  • 1 year later...

Hello! 

 

Does anyone know if it would be possible to add an Evernote tag via hazel (script) depending on the month and year? Have have a nested time related tag structure and it would be nice to add those automatically. For example: If pdf file is being imported today it would tag it with 12-Dec and  [2018]. 

 

How do I automate this tagging process during file intake. via hazel?

 

I hope I was able to explain the idea, if not, please let me know and I will try to come up with a better example. 

Thank you all in advance! 

-V

 

 

Link to comment
  • Level 5*
48 minutes ago, arantesvl said:

Hello! 

 

Does anyone know if it would be possible to add an Evernote tag via hazel (script) depending on the month and year? Have have a nested time related tag structure and it would be nice to add those automatically. For example: If pdf file is being imported today it would tag it with 12-Dec and  [2018]. 

How do I automate this tagging process during file intake. via hazel?

I'm not a Hazel user, but I understand Hazel Scripts are AppleScript.
Sample code is      assign tag theDate to theNote    
and you would assign theDate to whatever value you chose

Evernote Applescript is documented at https://dev.evernote.com/doc/articles/applescript.php

Link to comment

Archived

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

×
×
  • Create New...