Editorial Workflows

Create Evernote String

public 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: This workflow presents the user with a list of his or her Enernote notebooks and another list of his or her tags and, based on selections from the list, builds a string that the user can paste into the subject line of an email addressed to the user's Evernote account so that Enernote will assign a notebook and tags to the incoming note. Before it can be used, user must paste in a developer token in the locations marked in the python segments.

Workflow assembled by Jay Fogleman (fogleman2@gmail.com) from many pieces produced by others.

Shared by: Jay Fogleman, @fogleman

Comments: Comment Feed (RSS)

There are no comments yet.

+ Add Comment

Workflow Preview
Fetch Evernote Notebooks ?
Source Code
#coding: utf-8
import workflow
import console
import webbrowser
import keychain
import pickle
import evernote.edam.userstore.constants as UserStoreConstants
import evernote.edam.type.ttypes as Types
from evernote.api.client import EvernoteClient

#keychain.delete_password('evernote', 'editorial')

auth_token = 'insert EN Developer Token here,

#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

console.show_activity('Getting Tags...')
client = EvernoteClient(token=auth_token, sandbox=False)
note_store = client.get_note_store()

note = Types.Note()
s = []
console.hide_activity()
# List all of the tags in the user's account
notebooks = note_store.listNotebooks()
#console.show_activity('Getting Notebooks...')
for notebook in notebooks:
	
	s.append(notebook.name) 
	#console.show_activity('Getting Tags...')
	output = '\n'.join(s)
workflow.set_output(output)
Sort Lines ?
Sort Order
  • Ascending (A → Z)
  • Descending (Z → A)
Select from List ?
Title
List (Lines)
Input
Multiple Selection
OFF
Show in Popover
OFF
Prefix / Suffix Lines ?
  • Prefix
  • Suffix
Text
@
Set Variable ?
Variable Name
selected_noteobook
Value
Input
Fetch Evernote Tags ?
Source Code
#coding: utf-8
import workflow
import console
import webbrowser
import keychain
import pickle
import evernote.edam.userstore.constants as UserStoreConstants
import evernote.edam.type.ttypes as Types
from evernote.api.client import EvernoteClient

#keychain.delete_password('evernote', 'editorial')

auth_token = 'insert EN Developer Token here,

#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

console.show_activity('Getting Tags...')
client = EvernoteClient(token=auth_token, sandbox=False)
note_store = client.get_note_store()

note = Types.Note()
s = []
console.hide_activity()
# List all of the tags in the user's account
tags = note_store.listTags()
#console.show_activity('Getting Tags...')
for tag in tags:
	
	s.append(tag.name) 
	#console.show_activity('Getting Tags...')
	output = '\n'.join(s)
workflow.set_output(output)
Sort Lines ?
Sort Order
  • Ascending (A → Z)
  • Descending (Z → A)
Select from List ?
Title
Select Evernote Tags
List (Lines)
Input
Multiple Selection
ON
Show in Popover
OFF
Set Variable ?
Variable Name
fetched_tags
Value
Input
Prefix / Suffix Lines ?
  • Prefix
  • Suffix
Text
#
Run Python Script ?
Source Code
#coding: utf-8
import workflow

action_in = workflow.get_input()

## action_in = action_in.replace('\n', 'YY').replace('\r', 'YY')
## action_in = action_in.rstrip('\n\r')
action_in = action_in.replace(chr(10), "").replace(chr(13), "")
action_out = action_in
workflow.set_output(action_out)

action_out = action_in

workflow.set_output(action_out)
Set Variable ?
Variable Name
selected_tags
Value
Input
Set Variable ?
Variable Name
notebook_with_tags
Value
selected_noteobook selected_tags
Generate Text ?
Text
notebook_with_tags
Set Clipboard ?