Skip to content

Instantly share code, notes, and snippets.

@leonardobazico
Created July 18, 2019 18:37
Show Gist options
  • Save leonardobazico/402a99ca4e329946a52785c043838b68 to your computer and use it in GitHub Desktop.
Save leonardobazico/402a99ca4e329946a52785c043838b68 to your computer and use it in GitHub Desktop.
Export Apple Notes to Evernotes
tell application "Notes"
set myAccounts to every account
repeat with myAccount in the myAccounts
set myAccountName to the name of myAccount
set myAccountFolders to every folder of myAccount
repeat with myAccountFolder in the myAccountFolders
set myAccountFolderName to the name of myAccountFolder
set myAccountFolderNotes to every note of myAccountFolder
repeat with myAccountFolderNote in the myAccountFolderNotes
set myAccountFolderNoteName to the name of myAccountFolderNote
log myAccountName & " " & myAccountFolderName & " " & myAccountFolderNoteName
set myAccountFolderNoteBody to the body of myAccountFolderNote
set myAccountFolderNoteCreation to the creation date of myAccountFolderNote
set myAccountFolderNoteModification to the modification date of myAccountFolderNote
tell application "Evernote"
set newEvernoteNote to create note with text myAccountFolderNoteName title myAccountFolderNoteName notebook myAccountName & " " & myAccountFolderName tags [myAccountName, myAccountFolderName]
set the HTML content of newEvernoteNote to myAccountFolderNoteBody
set the creation date of newEvernoteNote to myAccountFolderNoteCreation
set the modification date of newEvernoteNote to myAccountFolderNoteModification
end tell
end repeat
end repeat
end repeat
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment