Editorial Workflows

MrReader_Link

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: Accepts an incoming Mr. Reader URL scheme trigger and creates a link-post article in Dropbox.

:::Macdrifter.com:::v.1.0

Shared by: Macdrifter.com

Comments: Comment Feed (RSS)

There are no comments yet.

+ Add Comment

Workflow Preview
Set Variable ?
Variable Name
incomingInput
Value
Input
Set Variable ?
Variable Name
urlString
Value
Set Variable ?
Variable Name
titleString
Value
Set Variable ?
Variable Name
postBody
Value
First Line to Variable ?
Source Code
#coding: utf-8
import workflow
import re

input_text = workflow.get_variable('incomingInput')



# convert to a list of lines
lines = input_text.split('\n')



workflow.set_variable('urlString', lines[0])
workflow.set_variable('titleString', lines[1])


new_string = '\n'.join(lines[3:])
workflow.set_variable('postBody', new_string)

workflow.set_output(new_string)
Request Text Input ?
Title
Post Title
Initial Text
titleString
  • Single Line
  • Multiple Lines
Keyboard Options:
Set Variable ?
Variable Name
titleString
Value
Input
Create New Timestamp File ?
Source Code
#coding: utf-8
import workflow
import os
import editor
import datetime
import webbrowser
import urllib

local_path = os.path.expanduser('~/Documents')

doc_title = workflow.get_variable('titleString')
doc_body = workflow.get_variable('postBody')
link_url = workflow.get_variable('urlString')

file_current_time = datetime.datetime.now().strftime('%Y-%m-%d_%H%M%S')
meta_date = datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')

file_name = doc_title + file_current_time +'.txt'

file_content = 'title: '+doc_title+'\nlink: '+link_url+'\ndate: ' + meta_date + '\n\n\n' + '[' + file_current_time + ']: ' + link_url

editor.set_file_contents(file_name, file_content,'dropbox')


webbrowser.open('editorial://open/' + urllib.quote(file_name) + '?root=dropbox')

action_in = workflow.get_input()

#TODO: Generate the output...
action_out = action_in

workflow.set_output(action_out)