Editorial Workflows

HTML to Evernote

unlisted workflow

Install Workflow...

This workflow contains at least one Python script. Only use it if you trust the person who shared this with you, and if you know exactly what it does.

I understand, install the workflow!

This is a workflow for Editorial, a Markdown and plain text editor for iOS. To download it, you need to view this page on a device that has the app installed.

Description: Converts markdown to HTML and posts to Evernote default folder.

Shared by: http://www.macdrifter.com/2013/08/editorial-for-ipad-a-landmark-in-ios-text-editors.html

Comments: Comment Feed (RSS)

anonymous — 23 Aug 2014
Hi, this workflow works great except when I try it on a note with footnotes, I am getting an error "EDAMUserException(errorCode=11,parameter='Element type "sup" must be followed by either attribute specification, ">" or "/>".') Can anyone suggest how to fix? Thx.
Cris — 01 Dec 2015
I just installed this workflow, pasted in my EverNote token, but I'm getting a "Workflow error", "Run Python Script": Line 37: EDAMUserException: EDAMUserException(errorCode=5,parameter='authenticationToken').

Do you have any tips on what I may be doing wrong?
Lorenz — 04 Dec 2015
I have the exact same problem as Cris…and I've tried several other markdown-evernote workflows?!?

+ Add Comment

Workflow Preview
Set Variable ?
Variable Name
title
Value
File Name
Run Python Script ?
Source Code
#coding: utf-8
import workflow
import webbrowser
import console
import keychain
import pickle
import evernote.edam.userstore.constants as UserStoreConstants
import evernote.edam.type.ttypes as Types
from evernote.api.client import EvernoteClient
import markdown2
import editor

#keychain.delete_password('evernote', 'editorial')
login = keychain.get_password('evernote', 'editorial')
if login is not None:
	auth_token = pickle.loads(login)
else:
	token_choice = console.alert('Token Needed', 'A Developer Token is needed. Go get one?', 'Yes', 'I have One', 'Cancel')
	if token_choice == 1:
		webbrowser.open('safari-https://www.evernote.com/Login.action?targetUrl=%2Fapi%2FDeveloperToken.action')
		raise KeyboardInterrupt
	elif token_choice == 2:
		auth_token = console.password_alert('Evernote Developer Token', 'Paste Your Evernote Developer Token')
		pickle_token = pickle.dumps(auth_token)
		keychain.set_password('evernote', 'editorial', pickle_token)
	else:
		raise KeyboardInterrupt



current_text = editor.get_text()
doc_title = workflow.get_variable('title')
html_text = markdown2.markdown(current_text, extras=['fenced-code-blocks','smarty-pants', 'footnotes'])


client = EvernoteClient(token=auth_token, sandbox=False)
note_store = client.get_note_store()

notebooks = note_store.listNotebooks()


# To create a new note, simply create a new Note object and fill in
# attributes such as the note's title.
note = Types.Note()
note.title = doc_title

note.content = '<?xml version="1.0" encoding="UTF-8"?>'
note.content += '<!DOCTYPE en-note SYSTEM ' \
   '"http://xml.evernote.com/pub/enml2.dtd">'
note.content += '<en-note>' + html_text + '<br/>'
note.content += '</en-note>'

# Finally, send the new note to Evernote using the createNote method
# The new Note object that is returned will contain server-generated
# attributes such as the new note's unique GUID.
created_note = note_store.createNote(note)

#print "Successfully created a new note with GUID: ", created_note.guid

console.hud_alert(doc_title+' saved to the default folder in Evernote','success')