Editorial Workflows

Manage Stories

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: A workflow to manage story ideas saved in an Story Ideas.md document in Dropbox.

Stories can be deleted or extracted into its own document for editing.

Comments: Comment Feed (RSS)

There are no comments yet.

+ Add Comment

Workflow Preview
Get Current File Name ?
Include Folder
ON
Include Extension
ON
Set Variable ?
Variable Name
currentDoc
Value
Input
Open Story Ideas ?
File Name
Story Ideas.md
In Dropbox
ON
Document Text ?
Folded Text
  • Include
  • Replace with:
Filter for all story titles ?
Output Lines That
  • Contain
  • Don't Contain
  • Match Regular Expression:
\d{4}-\d{2}-\d{2}\s-\s.*
Output Format
  • Only Lines
  • Lines and Ranges
Set Variable ?
Variable Name
list
Value
Input
Select from List ?
Title
Story Ideas
List (Lines)
Input
Multiple Selection
OFF
Show in Popover
ON
Store chosen story idea ?
Variable Name
listitem
Value
Input
Document Text ?
Folded Text
  • Include
  • Replace with:
Select Range ?
Range (from:to)
listitem
Relative to
  • Entire Document
  • Current Selection
Set Variable ?
Variable Name
selstart
Value
Sel. Range: Start
Set Variable ?
Variable Name
selmid
Value
Sel. Range: End
Select Range ?
Range (from:to)
Sel. Range: End
Relative to
  • Entire Document
  • Current Selection
Extend Selection ?
Direction
  • Backward
  • Forward
  • Both
Unit
  • Start/End of Document
  • Start/End of Line
  • Number of Characters...
1
Selected Text ?
Entire Line(s)
OFF
Empty Selection Output
  • No Output
  • All Text
  • Closest Word
Folded Text
  • Include
  • Replace with:
Search for the first instance of YYYY-MM-DD after the selected story & output its range ?
Source Code
#coding: utf-8
import workflow
import re
import string

action_in = workflow.get_input()
#action_in = action_in.encode('utf-8')

matched = re.search('\d{4}-\d{2}-\d{2}\s-\s.*', action_in)
#TODO: Generate the output...
action_out = str(matched.start())

workflow.set_output(action_out)
Set Variable ?
Variable Name
selend
Value
Input+selmid
Select Range ?
Range (from:to)
0
Relative to
  • Entire Document
  • Current Selection
Show Alert ?
Title
Story Idea
Message
listout
Button 1
Open
Output Value
open
Button 2
Remove
Output Value
delete
Button 3
(don't show)
Output Value
Show Cancel Button
ON
Open ?
Run the block if
Input
  • is Equal to
  • is Not Equal to
  • Contains
  • Doesn't Contain
  • Matches Regular Expression
open
Set Variable ?
Variable Name
filename
Value
Year: 2001-Month: 01-Day: 01-Hour: 01 (24h)-Minute: 01_newstory.md
Select Range ?
Range (from:to)
selstart:selend
Relative to
  • Entire Document
  • Current Selection
Set Variable ?
Variable Name
newdoc
Value
Input
Replace Selected Text ?
Replacement Text
Generate Text ?
Text
newdoc
Find / Replace ?
Find
---
  • Case-insensitive (A = a)
  • Case-sensitive (A ≠ a)
  • Regular Expression
Replace with
Set File Contents ?
File Name
%var:filename
In Dropbox
ON
New Text
Input
If File Does Not Exist
  • Create
  • Stop Workflow
Select Range ?
Range (from:to)
0
Relative to
  • Entire Document
  • Current Selection
Stop ?
Stop
  • This Workflow
  • Repeat Block
Show HUD Alert
OFF
Message
Stopped
…End If
Delete ?
Run the block if
Input
  • is Equal to
  • is Not Equal to
  • Contains
  • Doesn't Contain
  • Matches Regular Expression
delete
Select Range ?
Range (from:to)
selstart:selend
Relative to
  • Entire Document
  • Current Selection
Replace Selected Text ?
Replacement Text
Stop ?
Stop
  • This Workflow
  • Repeat Block
Show HUD Alert
OFF
Message
Stopped
…End If