Skip to content

Instantly share code, notes, and snippets.

@serayuzgur
Created October 20, 2015 08:10
Show Gist options
  • Save serayuzgur/dd42c4b2cc67abab5b31 to your computer and use it in GitHub Desktop.
Save serayuzgur/dd42c4b2cc67abab5b31 to your computer and use it in GitHub Desktop.
Exports from Evernote imports to Apple Notes iCloud Account.
tell application "Evernote"
set _Notebooks to every notebook
repeat with _NoteBook in _Notebooks
set _NoteBookName to name of _NoteBook
set _Notes to every note of _NoteBook
repeat with _Note in _Notes
set _NoteTitle to (title of _Note)
set _NoteText to (HTML content of _Note)
set _NoteCDate to the creation date of _Note
set _NoteMDate to the modification date of _Note
tell application "Notes"
tell account "iCloud"
if not (exists folder _NoteBookName) then
make new folder with properties {name:_NoteBookName}
end if
end tell
set theNoteID to make new note in folder _NoteBookName with properties {name:_NoteTitle, body:_NoteText, creation date:_NoteCDate, modification date:_NoteMDate}
end tell
end repeat
end repeat
end tell
@aeisenberg
Copy link

This is fantastic and it works for me (mostly). I had to wrap the set theNoteID statement in an if statement. Like this:

            if _NoteText is not missing value then
                log _Note
                set theNoteID to make new note in folder _NoteBookName with properties {name:_NoteTitle, body:_NoteText, creation date:_NoteCDate, modification date:_NoteMDate}
            end if

Otherwise, the import fails when it finds a deleted note. But, once I did that, I was able to import my notes all the way back from 2007.

@serayuzgur
Copy link
Author

serayuzgur commented Sep 19, 2016

It is a little bit late :) but glad to hear it worked (mostly).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment