Forked from pdxmph/import_notes_app_to_evernote.applescript
Last active
August 26, 2021 03:39
-
-
Save sowenjub/5138539 to your computer and use it in GitHub Desktop.
Updated to import the modification date as well since that's how notes are sorted in Note.app
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tell application "Notes" | |
set theNotes to every note of the folder "Notes" | |
repeat with thisNote in theNotes | |
set myTitle to the name of thisNote | |
set myText to the body of thisNote | |
set myCreateDate to the creation date of thisNote | |
set myUpdateDate to the modification date of thisNote | |
tell application "Evernote" | |
set theTransferredNote to create note with html myText ¬ | |
title myTitle ¬ | |
created myCreateDate ¬ | |
notebook "Imported Notes" | |
set modification date of theTransferredNote to myUpdateDate | |
end tell | |
end repeat | |
end tell |
If you have more than one account this no longer works. I cobbled together an applescript from the above and some apple resources that allows you to choose the account to import from and then it will import into Evernote.
tell application "Notes"
set thisAccountName to my getNameOfTargetAccount("Choose an account:")
tell account thisAccountName
set theNotes to every note of the folder "Notes"
repeat with thisNote in theNotes
set myTitle to the name of thisNote
log myTitle
set myText to the body of thisNote
set myCreateDate to the creation date of thisNote
set myUpdateDate to the modification date of thisNote
tell application "Evernote"
set theTransferredNote to create note with html myText ¬
title myTitle ¬
created myCreateDate ¬
notebook "Imported Notes"
set modification date of theTransferredNote to myUpdateDate
end tell
log "imported note to evernote"
end repeat
end tell
end tell
on getNameOfTargetAccount(thisPrompt)
tell application "Notes"
if the (count of accounts) is greater than 1 then
set theseAccountNames to the name of every account
set thisAccountName to ¬
(choose from list theseAccountNames with prompt thisPrompt)
if thisAccountName is false then error number -128
set thisAccountName to thisAccountName as string
else
set thisAccountName to the name of account 1
end if
return thisAccountName
end tell
end getNameOfTargetAccount
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Worked perfectly! Thank You so Much!!