Evernote Bulk Export

Summary: Export all the notes in Evernote to ENEX format, creating one file per notebook.
Requires: Evernote 7 (Evernote 10 does not support AppleScript)
Install Location: ~/Library/Scripts/Applications/EagleFiler/
Last Modified: 2020-12-11

Description

The easiest way to import from Evernote to EagleFiler is to select the desired notes in Evernote and press the capture key. However, for large numbers of notes, this can be slow, as it has to check which notebook each note belongs to. If you know that you want to import all the notes, it is more efficient to use this script to create a folder of ENEX files and then use EagleFiler’s Import ENEX File… command to import them. (You can drag all the .enex files into the open file panel at once to import them in a single step.)

This script requires that each Evernote notebook’s name can be a valid filename (not too long, no illegal characters) and that no two notebooks have the same name.

Installation Instructions · Download in Compiled Format · Download in Text Format

Script

on export()
    
tell application id "com.evernote.Evernote"
        
set _folderPath to my makeTempFolder()
        
set _notebooks to notebooks
        
repeat with _notebook in _notebooks
            
set _notes to notes of _notebook
            
if (count of _notes) > 0 then
                
-- assumes notebook's name is a valid filename and not the same as another notebook's
                
set _path to _folderPath & "/" & name of _notebook & ".enex"
                
with timeout of 2 * 60 * 60 seconds
                    
export _notes to POSIX file _path format ENEX with tags
                
end timeout
            
end if
        
end repeat
    
end tell
    
do shell script "open " & _folderPath's quoted form
end export

on makeTempFolder()
    
-- errAEPrivilegeError if inside of "tell"
    
do shell script "mktemp -d -t 'EFEvernoteExport'"
end makeTempFolder

my export()