« Three Clipboard to Plain Text options for the Mac | Main | Send to Evernote on Mac OS X »

Evernote watched folders on OS X

Following on from the send to Evernote addition for Evernote I also wanted to reproduce the Windows Evernote watched folders feature.  This allows a file moved to a specific folder to be automatically imported into a new note within Evernote and again can be accomplished with AppleScript.

The script to import the file into Evernote should be attached to the folder.  Right click on a folder and select "Folder Actions Set-up..." to access the naming and specifying for the folder's action.

The script is heavily based upon the send-to processing in the previous post so if you're interested in some of the details please have a read of that too.

NOTE: Thanks to Stephen Aument for finding an issue and fix in Mountain Lion. If you have an issue with the script silently failing, try changing:
create note from file item_path notebook "Auto Import"
create note from file this_item notebook "Auto Import"

on adding folder items to this_folder after receiving these_items
	repeat with anItem from 1 to number of items in these_items
		set this_item to item anItem of these_items
		set the item_info to info for this_item
		set the item_path to this_item as text
		tell application "Evernote"
				create note from file item_path notebook "Auto Import"
			on error error_message number error_number
				if the error_number is equal to 4 then
					-- The file being imported is not supported
					set userCanceled to false
						display dialog "Your Evernote account does not support the import of this type of file.  Why not consider upgrading?" buttons {"Cancel", "Go Premium"} default button "Cancel" cancel button "Cancel" with icon caution
					on error number -128
						set userCanceled to true
					end try
					-- If the user wishes they can be taken to the Evernote premium upgrade page
					if userCanceled is false then
						tell application "Safari"
							open location ""
						end tell
					end if
					-- Unspecified failure
					display alert "Import into Evernote failed" message "Error(" & error_number & "): " & error_message as warning
				end if
			end try
		end tell
	end repeat
end adding folder items to

beep 1

I use an unsynchronised notebook called "Auto Import" to take in files dropped into my particular watched folder. This means that I don't arbitrarily use up my monthly quota. You should amend this to the name of whatever notebook you would like to import to.

PrintView Printer Friendly Version

EmailEmail Article to Friend

Reader Comments (58)

Just wanted to say thanks for this. Been using it for ages and it was one the first things I installed after this weekends OS re-install. Cheers.

November 30, 2010 | Unregistered CommenterIan

Thanks very much - I've been looking for a solution like this for awhile. Makes 1-click scanning to evernote a reality for me!

December 3, 2010 | Unregistered CommenterBrent

This is terrific, I was looking for this functionality. Many thanks for a useful Christmas present.

How would I go about choosing a specific folder for the files to go into ? And would it be easy to do an import & send to trash functionality ?

Merry Christmas and Happy New Year to you !

December 24, 2010 | Unregistered CommenterDoug


Okay to auto delete the item after importing, replace...

create note from file item_path notebook "Auto Import"


create note from file item_path notebook "Auto Import"
tell application "Finder"
delete the this_item
end tell

I'm not 100% sure I understood the first part of your question, but I think you're asking how to set up the folder for this, here's how I did it, but if that's not what you were getting at let me know and I'll see if I can help.

First of all put your AppleScript into the AppleScript editor and save the script into "{user}\library\scripts\folder actions" where {user} is whatever your personal folder is on your Mac.

Now create yourself a folder - pretty much anywhere you like. Ctrl+Click/Right Click on the folder and (assuming you're using Snow Leopard) select "Folder Actions Setup..." from the "Services" sub-menu. Now select your script from the resulting list of folder action scripts and that's it.

I then created a shortcut/alias for my folder and popped it onto my desktop for easy access.

I hope that all helps.

Merry Christmas....

December 24, 2010 | Registered CommenterStephen Millard

Thanks for your efforts! Your other script, send file to Evernote, works great! But this script, I can't get it to work properly. I should make this script within Automator as an Mapaction, right?

December 25, 2010 | Unregistered CommenterMichael


You can either create the script in the AppleScript Editor as in my previous comment or if you're using Automator select "Folder Action" as a template for the workflow and then add the "Run AppleScript" action. Paste the script into the details for this action. Save it with a suitable name. As far as I know (and I'm sure there are many Mac users out there who may be able to correct me if I'm mistaken) this should be the same as saving the script to a specific location. I think both options have worked for me in the past.

December 30, 2010 | Registered CommenterStephen Millard

Fantastic script. Picked it up via Don McAllister's most recent tutorial. ScreenCastsOnLine Tutorial #284. I encourage anyone having problems with the script to view SCO0284. Thank you. I have many other uses for this script.

January 29, 2011 | Unregistered CommenterLamike

If anyone does have any problems with the script let me know and I'd be more than happy to help if I can.

January 30, 2011 | Registered CommenterStephen Millard

I have implemented the Script (THANKS!!) I tested with my FREE account and a PDF. I got the "Your Evernote account does not support the import of this type of file. Why not consider upgrading?" and I pressed Cancel...then the PDF appeared in my Evernote. Why? I am confused as to why PDF import is not supprted on a Free acct and why when I pressed Cancel, the file still appeared in my EN. Thanks!

February 9, 2011 | Unregistered CommenterMichael Ramm


The script has a check on line 13 where it looks for a return code of 4. From my experimentation when I wrote this script (I've since gone premium BTW), this was the code returned when I tried to import a file that wasn't supported by the free account.

Off the top of my head I don't know why it would successfully import the file and return that particular error number. Can you repeat this issue and is it repeatable just with the one PDF?

February 13, 2011 | Registered CommenterStephen Millard

This is the first time I've used a custom script to automate functions on my Mac. When I tried to implement this solution using the Automator method, I didn't have much luck. I was successful via the method prescribed for the AppleScript Utility. Thanks!

March 6, 2011 | Unregistered CommenterJoel Remigio

This is an excellent script thanks!

A nice addition to the script would be the ability to drop a folder into the watch folder, have the script recursively import items from the folder, and even possibly append the name of the dropped folder to the front of each item as it places the item into Evernote.

This could allow you to drop a folder named "Important Customer" into the the watch folder, and have all files imported as "Important Customer: Filename".


March 16, 2011 | Unregistered CommenterDan Lee

Stephen -
This is really a wonderful script -- very helpful. I've set it up to allow me to auto-import into evernote from a Canon printer, which I wasn't otherwise able to do (I can if I initiate the scan from my computer, but not from the buttons on the scanner). For that purpose, though, it'd be even better if it'd prompt for a file name (or even an Evernote item name). Any suggestions for how to accomplish that? (My applescript skills are limited to cutting and pasting, and even that is often touch and go.) Thanks!

June 15, 2011 | Unregistered CommenterBen

Ben - glad you like the script.

Okay first of all you can get some user input by adding in some lines like this (say after the 'tell application evernote' line)...

display dialog "Please enter a note title:" default answer "New note"
set NoteTitle to text returned of result

This will capture a note title from the user and pop it into a variable called NoteTitle.

You can then amend the create note from file line to the following...

create note from file item_path notebook "Auto Import" title NoteTitle

You can add more scripting in to handle defaulting the note title to the filename (rather than "New Note" or at least mention the name in the prompt text in case you're importing multiple files), to ask for tags (which would be ideal for Dan's suggestion I reckon if you made 'Important Customer' the tag) or even for different notebooks.

Hope that helps and inspires, or at the very least doesn't confuse matters.


June 15, 2011 | Registered CommenterStephen Millard


Great script! So useful! As a newbie to Applescript, though, I'm not sure how to add the different dialogs you referenced in your last comment. I'd love to be able to add a prompt for tags (or notebooks), but I'm not sure how to get Applescript to translate that into actually adding tags (or notebooks) to Evernote. Is there a reference guide somewhere for the different Evernote-specific Applescript commands?


July 27, 2011 | Unregistered CommenterCeleste


Glad you like the script.

Here's what the alterations for Ben might look like if you wanted to capture a note's title and then the tags for the note. If multiple tags are used, these could be separated by commas.

display dialog "Please enter a note title:" default answer "New note"
set NoteTitle to text returned of result

set AppleScript's text item delimiters to ","
display dialog "Please enter tags separated by a comma:" default answer ""
set NoteTags to text returned of result

The line of script to include the tags might then look like the one below.

create note from file item_path notebook "Auto Import" title NoteTitle tags NoteTags

You might want to tidy this up to gracefully deal with no tags being given by not trying to create the note with tags.

The details about the use of "create note" can be found in the Evernote AppleScript dictionary. In the AppleScript editor, select File > Open Dictionary... from the menu. Locate in the list and this wil load the documentation dictionary. If you search through you should find all the syntax and details about creating a new Evernote note in the "create note" section.

I hope that helps.


August 2, 2011 | Registered CommenterStephen Millard

I can't get the script to work or see the recommended screencast. I have a folder named "Dell" that i want sync'd automatically with my Evernote DELL folder. all it does is beep, no folder, nofiles :(

August 8, 2011 | Unregistered Commenterjeff

Hi! I was referred to your script by Evernote. I followed the instructions as best I could but nothing seems to work. I tried the automator instructions and I tried the script instructions (I'm using Lion on a MacBook Air and I couldn't find my library so I put the script into the main library on the root). I'm coming from Windows so am a total know-nothing about Mac yet. Is there anything else I should try? Thanks. Floyd

August 10, 2011 | Unregistered CommenterFloyd Whetzel


Sorry you're having problems with the script. I'm not sure exactly what screencast you're referring to, but I'll do my best to help.

First of all this isn't a synchronisation script. The script (when attached to a folder) keeps watching the folder and when one or more files is copied/moved to the folder it adds them into Evernote into separate notes. If you remove the files it will not remove the notes from Evernote, neither will any change in Evernote be cascaded back to the folder.

You say you get a beep so it suggests the script is running. the first thing i would suggest is checking that you have set "Auto Import" to be "Dell" or whatever the name is of the Notebook you have created in Evernote. If the notebook does not exist then the script can't add the files into notes.

The next thing to check is that you're copying in files that are able to be imported into Evernote. Too big or requiring or a file type that you don't have permission (premium accounts allows you to import any file type) to import could be an issue.

After that you probably want to use something like display dialog item_path to debug what's going on - e.g. display the name of each file being imported as the script runs.

Have a dig about, see what you find. Let us know what this throws up.

August 10, 2011 | Registered CommenterStephen Millard


I think the not finding the library folder is a Lion thing. By default Apple now hide it. If you open the Go menu in Finder and press and hold the ALT key, you should see an option for Library "Apple magically" appear.

Anyway, it sounds like the library you put the script in is the right place. Within the "Library" folder on the root of the drive, there is a "Scripts" folder. Within that is a "Folder Action Scripts". This is where your script file (.scpt) should be placed.

Find the folder you want to have run the action when files are put into it. Right click on the folder and select "Folder Actions Set-up..." from the "Services" sub-menu. This will open up the Folder Actions setting window. On the left pane click the + and then select your folder. In the right pane (with your folder selected ont he left), click the + and then you should see your script in the list. Select it, close the window and that should be it done.

Let me know how you get on with this.

August 10, 2011 | Registered CommenterStephen Millard

Well, I don't know what's different today. I used the ALT trick (thanks for that!) to find my library scripts. I put the file in there but the Folder Actions Setup wouldn't show it in the list for me to attach it. I then moved it into the Scripts folder off of the root of the drive and I was able to attach it fine. Maybe because I rebooted over the weekend..... All is working well now. Thanks for the assist!

August 15, 2011 | Unregistered CommenterFloyd Whetzel

Thank you for this! In Lion, I just put it in this folder

/Library/Scripts/Folder Action Scripts

Works great!

September 12, 2011 | Unregistered CommenterDarla

Thanks for the script. I have been dragging the file and dropping it on Evernote in my dock.

December 18, 2011 | Unregistered CommenterRay

Hello -

Just wanted to say THANKS for the Evernote scripts you've shared. Spent some time loading them tonight and super thankful for the opportunity to make workflow seamless.

One note about this particular script -- maybe a tip for those having trouble. In the directions provided to Floyd (8.10.2011); I had to ADD the folder "Folder Action Scripts" to then place the script in there. Once I did...everything worked perfectly!!

Thank you again!! Aloha, C

December 21, 2011 | Unregistered CommenterMoxie

Argh! I change my comment....I can't make this script work! Although I am VERY inexperienced (never used the automator program till tonight) I managed to get the right-click feature to work with Evernote. This folder one is not working out for me....

But, I think the problem is that the Automator is saving as a Workflow (not script) -- though I have no idea.

1. Once initially saved - the file is saved as .workflow and in services folder. (user\library\services)
2. Added Folder Action Scripts to Scripts folder; move file here
3. Changed folder name in script to match a notebook I want to point to within Evernote
4. When trying to implement action; a prompt box comes up asking if I want to install -- YES
5. I can choose script but nothing happens; if I try again, script is gone...go back to folders and workflow script has moved itself back to Services folder.....round and round we go!

I've tried deleting script to try again fresh
Rebooted programs & computer.
Nadah....grrrr...grouch now! Boo!!

December 21, 2011 | Unregistered CommenterMoxie


I managed to let the script work. Very nice! Now I have three maps I want to copy their files to three different notebooks in Evernote.(A, B and C) So I copied and changed the scripts to send the files to their own notebook. Files in folder A go to notebook A etc.
But it doesn't work properly. All the files keep coming in notebook A. Do you have any suggestions how I can manage this? It seems to go wrong in the map configuration panel.

December 22, 2011 | Unregistered CommenterHanna


Saving the file as a workflow I would bet is the source of your issues. When you open Automator you should get a list of options for starting a new automation. One of these is "Workflow". One of these should also be "Folder Action".

Try selecting "Folder Action" as your starting point and see how you get on. Any problems, let me know.


December 24, 2011 | Registered CommenterStephen Millard


Presumably your amendments have been to line 10 of the script; changing "Auto Import" to "A", "B" and "C" and saving these as different folder actions. This should work.

Unfortunately I'm not sure what the map configuration panel is that you refer to in where things are starting to go wrong.

Double check that you have created separate folder action scripts - I'd suggest maybe doing these from scratch in caes something got corrupted and retry.

If you (or anyone else) is still having problems you can contact me ... but sometimes it can take me a while to get time to look at people's problems (but I always do eventually). In such cases screen shots, copies of scripts and as detailed a description can be invaluable in helping me reproduce and resolve any issues.


December 24, 2011 | Registered CommenterStephen Millard


Very excited to find this but it's not working for me. When I drag a file over to my folder, I do get the "beep" but all that happens is that Safari is launched - no dialogue is presented to me and Safari isn't even opened to the Evernote site as specified in the script. I have a free account but am definitely dragging over supported files (small PDFs, jpgs, etc).

Any help greatly appreciated.


January 10, 2012 | Unregistered CommenterPaul

Hi Paul.

I'm going to assume you have Evernote installed and that since Safari is opening you're getting into the validation against the line that reads:
if userCanceled is false

So you should only be reaching this if you get an error code of 4 returned from Evernote to AppleScript (line 13). At the time of creating the script this was unsupported file types and I think it is probably unlikely that this has been changed (destroying backwards compatibility).

So odd to say the least. I'd therefore suggest seeing what effect the following has:
1. On line 12 add a "display dialog" for the error number - check it is returning a 4.
2. Try restarting your Mac and repeating the process.
3. Finally delete the folder and the script. Then recreate and once again see if you still get the same issue.

Let me know how you get on and obviously if anyone else has any thoughts please feel free to chip in :-)


January 10, 2012 | Registered CommenterStephen Millard

Great! - but I can't find the flattr button! :)

January 18, 2012 | Unregistered CommenterFelix

Hello -
I'm STILL trying desperately to get this to work!

1. I've installed the script
2. When I right click on folder action set up....the submenu opens...

Here is where I'm confused - should my new script (that I just installed) be one of the choices? Or is it the predefined list? If its should already be one of the choices (since I already installed)...then its not there.

If I'm supposed to choose "add-new item alert.scpt" (or one of the other predefined choices) -- when does the actually sync take place?

I have folders in DB & in Evernote that are named the same....I still have the Auto Import notebook too (which works fine with right-click script (thank you!).....argh!

January 29, 2012 | Unregistered CommenterMoxie

Felix - I hadn't come across Flattr before. I might well add that, but I've got a stack of things to do to the site when I get chance including adding a clip to Evernote button ;-)


Yes it should absolutely be one of the choices. If it isn't there, then something's gone wrong at an earlier step.

I've created a quick step-by-step guide with screen shots of what to do. Hopefully this will walk you through the process so that you can work out what has happened. Let me know how you get on with it, and if it seems good I'll link to it in the main blog post to try and save people any further pain :-)

If it isn't any good and you know exactly where you're seeing the issue, let me know and I'll try and correct it or just bin it.

You can get the step-by-step guide here Download the Evernote Watched Folder for Mac OS X Guide (PDF)

January 29, 2012 | Registered CommenterStephen Millard

Sorry to be such a newbie, but when I create a new folder action, what type of action am I using? A "run applescript" action? The script above does not seem to include the usual run/end run commands.

May 11, 2012 | Unregistered CommenterMichael Harvey

Michael - Did you by any chance read through the PDF from the previous comment?

· Download the Evernote Watched Folder for Mac OS X Guide (PDF)

If not give it a read through and let me know if that helps. Moxie never got back to me as to how useful this was / not, so I never linked to it in the main post. If you think it is helpful then I'll add a prominent link in to it.

June 20, 2012 | Registered CommenterStephen Millard

Hi Stephen,

I'm trying to run your script but not getting the expected results.

I'm running OS X 10.8 Mountain Lion Dev Preview and Evernote Version 3.1.2 (257203)

I used you pdf guide and noted that the script there is a little different to that on the original post. I could not get the original script to compile (it choked on the line starting 'open location "<a class="linkclass" ')

Anyhow, I edited the script to match the one in the pfd and it compiles fine.

I then used automator to set up a folder action. All fine. I set up the folder I wanted to sync by right clicking. All ok.

When I add a file (a txt document and a jpg in my test) I got the audio feedback and Safari launched on its homepage) but nothing appeared in the note book I had edited it to the code.

Any ideas what I might be doing wrong? I could provide you with the script as I have set it up if that will help.

Many thanks

July 4, 2012 | Unregistered Commenterjohnwin


Sorry you're having troubles with the script - it should just work.

First of all the script on the web site is exactly the same as the script in the PDF. It shouldn't need any modification to get them inline. However the 'open location ">a class="linkclass" ' entry looks like the copy you took was of the HTML rather than the text of the script section. Perhaps that's a feature of the browser? In any case I'm assuming you have an exact copy of the text content now.

So it could be that this is an issue with the OS you are running and Evernote/Safari. You're running the Mountain Lion preview for developers so it could be a bug or a functionality change - e.g. in the Safari AppleScript functionality. Unfortunately I'm not running the preview and will not be putting it on my Mac as I need a stable OS for my day to day use.

It may however be that it is unrelated to the OS so I'll see if I can offer up something of an approach to investigating further.

First of all I would try removing the script & folder action and starting again from scratch making sure that you have just the text content for the script. I've uploaded a plain text version to the site you can open and copy and paste from: download here.

Previously you seem to be getting Safari opening even without being prompted in any way which should never happen so maybe the next step would be to try simplifying the error handling. Next try replacing the error handling code (lines 13 to 32) with

beep 4
display alert "Import into Evernote failed" message "Error(" & error_number & "): " & error_message as warning

This will give 4 beeps on any error and then display the details of the error. Safari should not open and afterwards, the script should finish as normal (one beep).

It may also be worth uninstalling and reinstalling Evernote. Occasionally applications can be corrupted and a clean install can resolve some of the stranger quirky issues. But before doing this I'd explore the other things I've mentioned.

I hope that helps and at least gets us one step closer to figuring out what's causing your issue.


July 8, 2012 | Registered CommenterStephen Millard


Thanks for the reply. I think it must be an issue with Mountain Lion. I've followed all of your advice above but to no avail.

Thanks again.

July 8, 2012 | Unregistered Commenterjohnwin


Thanks for the great script!

This is for anyone having trouble on Mountain Lion. I'm using Evernote 3.3.0 on Mountain Lion and I had to change:

create note from file item_path notebook "Auto Import"


create note from file this_item notebook "Auto Import"

Once I replaced the file name with the actual file handle it worked like a champ. Before I did that it would fail silently.


August 29, 2012 | Unregistered CommenterStephen Aument


Thank you so much for this brilliant script!

I had it working on Snow Leopard, but can't find where to put the script on my Macbook Air running Mountain Lion.

Any help is appreciated!

August 29, 2012 | Unregistered CommenterBlueBoy

Is there a way to enhance this so that when creating the note in Evernote, it would populate the Created & Updated fields in the note with the Created & Updated date from the document?

August 31, 2012 | Unregistered CommenterBrendan

Great result Step - I'll put a note in the main post about that.

Thanks for sharing.

September 27, 2012 | Registered CommenterStephen Millard

Blue Boy.

If you're having trouble finding the library directory, go into Finder and open the Go menu. Then hold down the ALT key and hopefully you should see the Library folder appear in the menu.

If that's not the issue, have you tried following the instructions in the PDF guide?

September 27, 2012 | Registered CommenterStephen Millard


You should be able to use the some AppleScript with Finder to get the properties of the file, and it looks like there are some note properties that you can set via AppleScript. I think the trick would be identifying the note to set the properties. if you could work out how to do that reliably then I think you could do it.

Perhaps a search for the filename of the imported file and a small time range (so as to account for duplicate filenames over time) would work?

September 27, 2012 | Registered CommenterStephen Millard

Great script. I modified it to add tags, but I am unable to get Evernote to accept the comma separated tags. I can only add one tag. I am running Evernote 5.

December 24, 2012 | Unregistered CommenterPhilip Toews

1000 Thank You's for this wonderful script. I have tinkered around with it to adjust to my needs but there is one thing I cannot figure out which is critical to the way I use the script. I would like to find out how to set the creation date of the Evernote as it is being imported. (i.e. I am doing this with Tags and the Note Title). I tried the following but I get an error message.

display dialog "Creation Date?" default answer ""
set creationdate to text returned of result

I am entering this information in the dialog box as that is what looks to be the format of Evernote:
11/11/2011 12:00 PM

January 2, 2013 | Unregistered CommenterCathy

Just a quick thanks. 15 minutes fiddling, and this works brilliantly

January 12, 2013 | Unregistered Commentermrsean2k


The date is an object so I think your problem is that you might be treating it like a string of text. See if the following helps you out...

tell application "Evernote"
set myDate to date "Saturday, 1 January 2000 14:15:16"
create note with text "This note was created on Saturday, 1 January 2000 at 14:15:16" title "This is my creation date specified note" created myDate
end tell

January 13, 2013 | Registered CommenterStephen Millard

I believe we are on the right path, however, by using the code you provided above I am never given the opportunity to insert the date I want.

display dialog "Date?" default answer ""
set myDate to date returned of result

Results in an error message:
Variable returned is not define
Error number 2753

Forgive me I'm new and I am trying to learn.

January 25, 2013 | Unregistered CommenterCathy

Hi Cathy.

Here's an example for you that I hope you'll find straight forward enough to work into your own customised script. It prompts you to enter the date and time (defaulting to the current date and time to help you get the format right) in two separate dialog boxes (so you can always preset one part and not ask for it if you like) and then uses that information to create a new note in Everenote (default notebook) with an appropriate creation timestamp.

--Initialise to current date and time
set strDate to date string of (current date)
set strTime to time string of (current date)

--Get the user to specify a date
set strTSDate to text returned of (display dialog "Enter a date:" default answer strDate buttons {"OK"} default button 1)

--Get the user to specify a time
set strTSTime to text returned of (display dialog "Enter a time:" default answer strTime buttons {"OK"} default button 1)

--Combine the two and convert to an object
set strTimestamp to strTSDate & " " & strTSTime
set objTimestamp to date (strTimestamp)

--Create a note in Evernote with the creation time in the title
-- and set the note so that it appears to have been created at that time
tell application "Evernote"
set strNoteTitle to "This note was created on " & strTSDate & " at " & strTSTime
set strNoteContent to "Lorem ipsum dolor…"
create note with text strNoteContent title strNoteTitle created objTimestamp
end tell

January 25, 2013 | Registered CommenterStephen Millard

PostPost a New Comment

Enter your information below to add a new comment.
Author Email (optional):
Author URL (optional):
Some HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>