Skip to content

Instantly share code, notes, and snippets.

@5c0tt
Last active August 29, 2015 14:19
Show Gist options
  • Select an option

  • Save 5c0tt/5f30b872bb2c03599ad6 to your computer and use it in GitHub Desktop.

Select an option

Save 5c0tt/5f30b872bb2c03599ad6 to your computer and use it in GitHub Desktop.
Backup Evernote on Macintosh
-- Copy and paste all the code below into your Script Editor and run it as you see fit
-- PURPOSE: Export all notes in Evernote to an ENEX file so that
-- the notes can be backed up to an external drive or to the cloud
-- Change the path below to the location you want the notes to be exported
set filename to (do shell script "date '+%Y-%m-%d-%H.%M.%S'") & (".export.enex")
-- Get the path the Application Support and then append the backup folder
set e to path to application support from user domain
set p to POSIX path of e & "Evernote-Backups/"
-- If the folder is not there, make it for the user, this fails gracefully
-- if the folder is there
do shell script "mkdir -p " & (quoted form of p)
set f to (p & filename)
display dialog f
-- Iterate through all your records and export them
with timeout of (30 * 60) seconds
tell application "Evernote"
-- Set date to 1990 so it finds all notes
set matches to (find notes "created:19900101")
-- export to file set above
export matches to f
end tell
end timeout
-- Compress the file so that there is less to backup to the cloud
set p to POSIX path of f
do shell script "/usr/bin/gzip " & (quoted form of p)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment