Some Pixels en / pt

Evernote Dropbox

I've started using the nice Screen Capture Chrome extension to grab some screenshots for my Evernote web design inspiration collection. The problem is that this extension can't send the screenshots directly to Evernote, so I needed to do it manually all the time.

After some research, I've come up with a better solution to the problem. I've developed a small AppleScript to check a folder for new files and e-mail those files to Evernote:

on adding folder items to this_folder after receiving these_items

    repeat with anItem from 1 to number of items in these_items

        -- Read file info
        set this_item to item anItem of these_items
        set the item_info to info for this_item
        set the file_name to name of item_info
        set the file_extension to name extension of item_info
        set the item_path to this_item as text

        -- Remove extension from name
        if file_extension is not "" then
            set _length to (count of file_name) - (count of file_extension) - 1
            set the file_name to text 1 thru _length of file_name
        end if

        -- Start new e-mail
        tell application "Mail"

            -- Set file name + #tag as subject
            set theMessage to make new outgoing message with properties {visible:true, subject:file_name & " #tag #other_tag", content:""}

            tell theMessage

                -- Add evernote email as recipient
                make new to recipient at end of to recipients with properties {name:"Evernote", address:"YOUR_EVERNOTE_EMAIL@m.evernote.com"}

                -- Attach file
                tell content
                    make new attachment with properties {file name:item_path} at after last paragraph
                end tell

                -- Uncomment next line to send the e-mail automatically
                -- send

            end tell
        end tell
    end repeat

end adding folder items to

How to use it:

  1. Get your Evernote e-mail address at: https://www.evernote.com/Settings.action
  2. Open the tool "AppleScript Editor"
  3. Copy and paste the script there
  4. Change YOUR_EVERNOTE_EMAIL to your e-mail address
  5. Change #tag #other_tag to any existing tag, if you want, or remove it
  6. Save it as "Mail to Evernote" at "/Library/Scripts/Folder Action Scripts/"
  7. Create a folder anywhere you want. Call it "Evernote Dropbox" or something you like.
  8. Right click this folder, select Services/Folder Actions Setup...
  9. Select the "Mail to Evernote" script
  10. Toggle "Enable Folder Actions"
  11. Uncomment the send command to send the e-mail automatically, if you want

Now save some screenshot at this folder and wait for the new Mail message to be created... ;)