Jump to content
2019 Calendar Templates Read more... ×
wlmorin

mac 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

Share this post


Link to post

Change your script to:

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

Share this post


Link to post

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

Share this post


Link to post

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

Share this post


Link to post

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.

Share this post


Link to post

Lew

 

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

Share this post


Link to post

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

Share this post


Link to post

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!

Share this post


Link to post

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

Share this post


Link to post

Stacks cannot contain notes, they can only contain notebooks.

What you probably want to do is add the note to a specific notebook within the stack.

The script you have should be able to handle that already.

Share this post


Link to post

Does anyone have an idea on how to append the title of the note?

 

I want to have it say something like "Checking Account Statement: " and then place the title of the file.

 

Thanks in advance!

Share this post


Link to post

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

Share this post


Link to post

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.

Share this post


Link to post

@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.

Share this post


Link to post

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

Share this post


Link to post
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

 

 

  • Like 1

Share this post


Link to post

@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?

Share this post


Link to post
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

Share this post


Link to post

@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.

Share this post


Link to post
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"
 

Share this post


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

Share this post


Link to post

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

 

 

Share this post


Link to post
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

  • Like 2

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

×