Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I export notes from Evernote using AppleScript?

I'm trying to export notes from Evernote v.3.3.0 in HTML format to a location on disk using AppleScript. The task at hand doesn't seem to be particularly complicated, but my being relatively new to Evernote, and completely new to AppleScript doesn't help much... ;)

Here's what I have come up with so far - any comments are much appreciated!

tell application "Evernote"
    set allmynotes to find notes
    set outputpath to "/Users/{myusername}/Desktop/Test"
    export allmynotes to outputpath format HTML
end tell

From what I understand, exporting as HTML creates a single file per note, which is why I assumed I needed to specify an output folder name instead of an output file name. Another assumption is the fact that the script, when double-clicked, will run with the credentials of the active user; on my machine, this user has sufficient permissions to write to the specified folder.

Results until now are Evernote got an error: Unable to remove existing output file." number 1 and Evernote got an error: Unable to create output directory.. Any ideas?

Many thanks in advance! :)

like image 903
Jan Hoek Avatar asked Aug 13 '12 18:08

Jan Hoek


2 Answers

Victory at last! The problem had nothing to do with my script, and everything with the fact that I had installed Evernote from the App Store. The App Store version, unlike the version that can be downloaded from evernote.com, is limited by App Sandboxing in Mac OS X. Now, with the non-App Store version installed, the scripts above work perfectly.

Thanks again for answering, and for those experiencing the same issues - I hope that your problems are also solved by the above.

like image 100
Jan Hoek Avatar answered Oct 06 '22 19:10

Jan Hoek


Think it's a bug in 3.3 -- I have written a fair number of AppleScripts for Evernote (including ones with working export functions) and have recently encountered the same types of "permission" errors.

When I reached out to Evernote Developer Support, they replied that their team is currently looking at the issue. I will forward this page to them for their reference and, hopefully, version 3.3.1 will bring a fix!

like image 30
Justin Lancy Avatar answered Oct 06 '22 21:10

Justin Lancy