Editorial Workflows

SelfEditing_Workflow

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: WARNING! DON'T RUN WHILE EDITING,THE WORKFLOW MAY GET DAMAGED

Run the workflow OUT of the workflow editor,modify the variable and press the blue button.edit the workflow and see that the variable value is the text entered by you

Filippo Claudi

Comments: Comment Feed (RSS)

There are no comments yet.

+ Add Comment

Workflow Preview
Set Variable ?
Variable Name
var
Value
Badabeem Badaboom!
Run Python Script ?
Source Code
#coding: utf-8
import editor
import json
import workflow
#Doesn't work if the workflow is opened in the editor
workflow_filename ='1B737520-882A-41E5-B5DA-22E5EF812AF9.wkflw' # change this
input=workflow.get_input()
# Read the workflow data:
with open(workflow_filename, 'r') as f:
  workflow_dict = json.load(f)

# Modify it:
actions = workflow_dict['actions']
first_action = actions[0]
parameters=first_action['parameters']
value=parameters['value']
value['text']=input

# Save the modified workflow data:
with open(workflow_filename, 'w') as f:
  try:
  	dump=json.dumps(workflow_dict)
  	print >> f,dump
  except:
		print 'error'
		f.close()
editor.reload_workflows()