Advertisement
Guest User

Untitled

a guest
Apr 21st, 2015
335
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. -- PURPOSE: Export all notes in Evernote to an ENEX file so that
  2. -- the notes can be backed up to an external drive or to the cloud
  3.  
  4. -- Change the path below to the location you want the notes to be exported
  5. set filename to (do shell script "date '+%Y-%m-%d-%H.%M.%S'") & (".export.enex")
  6.  
  7. -- Get the path the Application Support and then append the backup folder
  8. set e to path to application support from user domain
  9. set p to POSIX path of e & "Evernote-Backups/"
  10.  
  11. -- If the folder is not there, make it for the user, this fails gracefully
  12. -- if the folder is there
  13. do shell script "mkdir -p " & (quoted form of p)
  14. set f to (p & filename)
  15. display dialog f
  16.  
  17. -- Iterate through all your records and export them
  18. with timeout of (30 * 60) seconds
  19. tell application "Evernote"
  20. -- Set date to 1990 so it finds all notes
  21. set matches to (find notes "created:19900101")
  22. -- export to file set above
  23. export matches to f
  24. end tell
  25. end timeout
  26.  
  27. -- Compress the file so that there is less to backup to the cloud
  28. set p to POSIX path of f
  29. do shell script "/usr/bin/gzip " & (quoted form of p)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement