Skip to content

Instantly share code, notes, and snippets.

@mshk mshk/gist:6276780 forked from matsubo/gist:2543898
Last active Dec 21, 2015

Embed
What would you like to do?
Read files under the folder you choose and add them to Evernote as text note. Updated version of https://gist.github.com/matsubo/2543898 . Difference is that this script reads contents of the text files and set them as contents of newly created Evernote notes, instead of adding text files as attachments.
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 with text (read currentFileLocation)
set (modification date of theItem) to modFileDate
end tell
end repeat
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.