Editorial Workflows

Sort by @due

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: Sort selected text by the dates in @due(YYYY-MM-DD) tags. Made for use with TaskPaper files.

Shared by: Derick Fay - http://dfay.fastmail.fm/et/

Comments: Comment Feed (RSS)

There are no comments yet.

+ Add Comment

Workflow Preview
Selected Text ?
Entire Line(s)
OFF
Empty Selection Output
  • No Output
  • All Text
  • Closest Word
Folded Text
  • Include
  • Replace with:
Run Python Script ?
Source Code
#coding: utf-8
import workflow
import re

theText = workflow.get_input()
theList=[]
action_out=""

for i in theText.splitlines():
	match = re.search('@due\(\d\d\d\d\-\d\d\-\d\d\)',i)
	if match:
		theKey = i[i.find('@due(')+5:i.find('@due(')+15]
	else:
		theKey =''
	theList = theList + [(theKey, i)]

for i in sorted(theList):
	action_out = action_out + i[1]+"\n"

action_out = action_out[:-1]
workflow.set_output(action_out)
Replace Selected Text ?
Replacement Text
Input