Jump to content

Import all my notes from Apple Notes to Evernote


Recommended Posts


Experts! Need your advise!

I've searched various forums and tried using scripts to export Apple Notes to Evernote, but unfortunately nothing has worked. The discussions I found are outdated and it seems that changes to Apple Script or MacOS have caused the scripts to stop functioning.

I even contacted Apple support, but the only option they gave me was to export notes one-by-one as a PDF, which is not a format that Evernote can import. I'm stuck and could use some help.

Copy-pasting has been a pain, as images are lost and formatting and colors are not preserved. I have about 200+ notes and 1000+ images, so this process is very time-consuming. I've tried for days to get the Apple scripts working but have had no luck. Any suggestions would be greatly appreciated!

 

https://lwilli.github.io/2018-02-04-How-to-copy-mac-notes-to-evernote/

image.png.c65bd6d24779fa0b2cdc13ab78114e1a.png

Link to comment

Thanks @gazumped

I tried that already, and it is not desirable. PDF is imported into Evernote as a PDF but not converted to Evernote note. I will not be able to edit the notes which is not desirable. It works just like a dropbox or google drive.

Looking for options to have it as a editable note.

  • Like 1
Link to comment

Yeah, that was the first thing I tried (LOL!!). Things have changed and it does not work. Unless someone can help come up with a version that works with Mac OS Ventura.

Thanks for the suggestion though. Appreciate it!

  • Like 1
Link to comment
-- Apple Notes Exporter version 1.0
-- By Johan Sanneblad
-- Exports all Apple Notes in folders with filename "<creation date> <title> [<id>]"
set exportFolder to (choose folder) as string

-- Simple text replacing
on replaceText(find, replace, subject)
	set prevTIDs to text item delimiters of AppleScript
	set text item delimiters of AppleScript to find
	set subject to text items of subject
	
	set text item delimiters of AppleScript to replace
	set subject to "" & subject
	set text item delimiters of AppleScript to prevTIDs
	
	return subject
end replaceText

-- Returns an HTML file to save the note in.  We have to escape
-- the colons or AppleScript gets upset.
-- noteContainer must end with ":"
on noteNameToFilePath(noteContainer, noteName)
	global exportFolder
	set strLength to the length of noteName
	
	if strLength > 250 then
		set noteName to text 1 thru 250 of noteName
	end if
	
	set noteFolder to exportFolder & noteContainer
	
	-- Create folder if it does not exist
	set outputFolder to POSIX path of (noteFolder as text)
	do shell script "mkdir -p " & quoted form of outputFolder
	
	set fileName to (noteFolder & replaceText(":", "_", noteName) & ".html")
	return fileName
end noteNameToFilePath


tell application "Notes"
	
	repeat with theNote in notes of default account
		
		set noteLocked to password protected of theNote as boolean
		set noteModificationDate to modification date of theNote as date
		set noteCreationDate to creation date of theNote as date
		
		set noteID to id of theNote as string
		set oldDelimiters to AppleScript's text item delimiters
		set AppleScript's text item delimiters to "/"
		set theArray to every text item of noteID
		set AppleScript's text item delimiters to oldDelimiters
		set noteFolder to ""
		
		if length of theArray > 4 then
			-- the last part of the string should contain the ID
			-- e.g. x-coredata://39376962-AA58-4676-9F0E-6376C665FDB6/ICNote/p599
			set noteID to item 5 of theArray
		else
			set noteID to ""
		end if
		
		if not noteLocked then
			
			set theText to body of theNote as string
			set theContainer to container of theNote
			
			try
				repeat while theContainer is not missing value
					set noteFolder to (name of theContainer) & ":" & noteFolder
					set theContainer to (container of theContainer)
				end repeat
			end try
			
			-- prefix all notes by creation date (YYY-MM-DD)
			set yy to (year of noteCreationDate as text)
			-- set yy to text -2 through -1 of (year of noteCreationDate as text)
			set mm to text -2 through -1 of ("0" & (month of noteCreationDate as integer))
			set dd to text -2 through -1 of ("0" & (day of noteCreationDate))
			set datePrefix to yy & mm & dd
			
			-- file name composed by creation date + note title + id (to prevent overwriting files from the same date with same title)
			set fileName to ((datePrefix & " " & name of theNote as string) & " [" & noteID & "]") as string
			set filepath to noteNameToFilePath(noteFolder, fileName) of me
			set noteFile to open for access filepath with write permission
			
			write theText to noteFile as «class utf8» -- if you want UTF-16 replace this with "as Unicode text"
			
			close access noteFile
			
			tell application "Finder"
				set modification date of file (filepath) to noteModificationDate
			end tell
		end if
		
	end repeat
	
end tell

 

Here you go. It also exports folders as folders. If you don't want to prefix the notes with date just remove it. There is lots of configuration you can do to fit your individual needs.

 

  • Thanks 2
Link to comment

I am sorry, I could not test this yet. I want to make sure the program does not affect the existing notes in Apple Notes or in Evernote so thinking of alternate accounts to try this out; sometime this weekend.

Link to comment

I ran ahead an executed the program but it terminates with an error as below:

error "Notes got an error: An error of type -116 has occurred." number -116 from "<div><h1>Screws</h1></div>

<div><br></div>

<div><img style=\"max-width: 100%; max-height: 100%;\" src=\"data:image/

There's much more data that below these but did not post due to some personal data / info.

I do see part of the Notes getting exported to a choosen folder in my mac but I think the program is half way through. Thoughts?

Link to comment
  • Level 5

The usual and officially documented way of importing is via ENEX:

https://help.evernote.com/hc/en-us/articles/360035153274

or through a zip-File, but this is somehow weakly defined:

https://help.evernote.com/hc/en-us/articles/208314308

Export to HTML is usually seen as the export method if you want an export that you can read with any browser, independently from EN.

https://help.evernote.com/hc/en-us/articles/209005557

Link to comment

Hmm... [scratch, scrath, scrath,...]

ZIP - Extract to folder > files must be in ENEX - so deflates the purpose.

Wondering what's the point of exporting Apple Notes to HTML if I can't import into Evernote and use it (edit).

Reading independently off of Evernote was not my real venture. I can keep my apple notes.

Looks like I am back to square one!

Link to comment
  • 2 months later...

Just discovered this thread. This is a topic I have messed with over the years. That script seems to work but will not include attachments that are not the usual suspects from what I can see. One of the reasons I stuck with Evernote for the longest time was that .enex always included everything when importing into another notes app. Made it easy to play with other tools even if only temporarily. Would be cool to get some AppleScript that created an .enex file that included everything but I'm not sure where to even start.

Link to comment
  • Level 5

If you search for „apple notes bulk export“ you will be offered a number of options.

I would simply try with a certain set of notes in Apple Notes, until I find a solution working for my data, including attachments.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...