Sunday, January 29, 2012

Evernote Watched Folder on Mac Snow Leopard

Maybe you're a PC going Mac, or just a Mac looking to save a few clicks, but in either case you could reasonably expect this PC-only feature of Evernote to be available on Snow Leopard: watched folders. Basically, this ensures that most documents put into a particular folder find their way into a new note in Evernote. This is useful is you want to save PDFs, for example, that are not clipped in the way standard HTML pages are when using the Evernote Web Clipper plug-in for your favorite browser.

To add this feature to Evernote, we can use it's AppleScript interface through a Folder Action we will create in Automator.

  1. Start Automator

  2. Create a new Folder Action

  3. Select the folder you want

  4. Add a Run AppleScript task to the workflow

  5. Add the following code to the task:

    on run {input}
    tell application "Evernote"
    repeat with x in input
    create note from file x notebook "Auto Import"
    on error error_message number error_number
    display alert "Send to Evernote Failed" message "Error: " & error_message & " " & "Error Number: " & error_number as warning
    end try
    end repeat
    end tell
    end run

  6. Save it (File->Save a version)

  7. Navigate to the folder in finder and ensure that there is a folder action assigned

  8. Add a Notebook to Evernote called "Auto Import"; this step is optional, but you must remove the 'notebook "Auto Import"' from the code. If you do remove it, the note will be added to your default notebook.

  9. Save files to the folder