Jump to content

(Archived) Exporting to HTML via the command line


Recommended Posts

I'm looking for a way to automatically back up my notes in a format that makes them easy to read if I ever lose access to Evernote. HTML fits the bill perfectly, but I can't find a way to automate the process. I've read some articles about how to use command-line arguments and the Task Scheduler to automatically export from Evernote, but as far as I can tell, the only option is to export to an .enex file. Does anyone know if it's possible to export to an HTML file using the command line?

Link to comment

Thanks for the info. I haven't found any useful 3rd party tools either, but I'll look into AutoHotKey.

If any of the Evernote staff see this: Is there a reason that ENScript only exports to .enex? Would it be possible to include a feature in future versions that allows users to export to html as well?

Link to comment
  • Level 5*

Images and other binary content are all encoded into text right in the output .ENEX file. For HTML exports, images are written out to a separate file, and linked to from the HTML. Other binary content like attachments as well, I would expect.

Link to comment
  • 8 months later...

Thanks for the info. I haven't found any useful 3rd party tools either, but I'll look into AutoHotKey.

If any of the Evernote staff see this: Is there a reason that ENScript only exports to .enex? Would it be possible to include a feature in future versions that allows users to export to html as well?

What about Mac users? I'm also looking for a .enex backup tool. 

Link to comment

@kitus:

 

Since this thread was opened (back in 2012), Evernote has introduced HTML backup functionality. In the File>Export notes... dialog, you can chose from Evernote XML File and HTML. When carrying out HTML exports, attachments will be exported as files in the export directory.

 

As far as automating export goes, there are several parts in this:

1. triggering the export process

2. automating the export process proper

3. Taking measures that the exports ultimately gets saved to an external backup location (not your Mac's hard drive)

 

Regarding (1) and (3), I don't really have a one-size-fits-all solution. It too strongly depends on personal preference. I personally would go the following route: Start (1) manually once in a while (not automatically), because the export will take quite a while. And, as for (3), the export would be saved somewhere on my internal hard drive where it automatically gets processed by my regular time machine backups.

 

Regarding (2): You could create an applescript with AppleScript Editor, which you launch every time you want to create a backup. A convenient script for my situation would look like this:

 

 

set folderName to "Latest Evernote HTML Export"

set exportFolder to (path to documents folder as text) & folderName as text

tell application "Finder"

if exportFolder exists then

set answer to the button returned of (display dialog "This will overwrite the previous Evernote HTML export" buttons {"Stop", "Overwrite"} default button 1)

if answer is equal to "Stop" then

error number -128 -- end script with error "User Cancelled"

end if

end if

end tell

 

tell application "Evernote"

set allNotes to find notes

export allNotes to exportFolder format HTML

end tell

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...