Date Sensitive File Importer

Shared By: Adam

Description

Takes a folder full of files and creates Evernote entries. It will make a new notebook named after the containing folder and the new notes are titled with their file name. The new notes use the “date created” and “date modified” as their “created” and “updated” dates.

I took the bulk of the script from an old post here and updated it to recognize the date modified field, for those of us who are particular about that sort of thing.

The Code

set listOfNames to {}
set theFolder to choose folder "Select the source folder"

tell application "Finder"
    set filelist to every file of the folder theFolder
    repeat with currentFile in filelist
        set currentFileName to (the name of currentFile)
        set nom to currentFileName
        if text -4 of nom is "." then
            set currentFileName to (text 1 thru -5 of nom)
        end if
        set currentFileDate to (the creation date of currentFile)
        set modFileDate to (the modification date of currentFile)
        set currentFileLocation to currentFile as alias
        set currentFileFolder to (the name of theFolder)
        tell application "Evernote"
            set theItem to create note title currentFileName created currentFileDate notebook currentFileFolder from file currentFileLocation
            set (modification date of theItem) to modFileDate
        end tell
    end repeat
end tell

2 Responses to “Date Sensitive File Importer”

  1. Steve Jamieson says:

    Adam, wonderful script.

    Is there any way you can give us a choice of destination notebook? I frequently import large numbers of 2-5MB pdfs in big chunks. I would prefer to direct them to a non-synced folder just in case I don’t want them shared.

    Your current script creates a new synced notebook. Once the script starts you can’t stop EN from uploading. The folder today was a 200MB lump of a thing – 200MB wasted from my monthly quota. Would like to get into a non-synced folder then transfer the docs I want.

    Do-able?

    Many thanks.

    Steve J

  2. Michael says:

    Thank you, this helped a lot.

rss Subscribe to Comments RSS Feed


You can use these tags in your comment: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>