Editorial Workflows

Due Today <TP>

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 goes over an open Taskpaper file and shows tasks that are overdue, due today or have a @today tag, folding all other lines. It also shows project names as reference.

More info here: http://bit.ly/1GzWBNe

www.movingelectrons.net

Shared by: @LeninRzSz

Comments: Comment Feed (RSS)

silop — 16 May 2017
Great workflow, one minor complaint though: it ignores the task with due dates having time entry. Any comments?

+ Add Comment

Workflow Preview
Run Python Script to Get Regex Text. ?
Source Code
#coding: utf-8
import workflow
import editor
import re
import datetime
import sys

text = editor.get_text()
mainList = text.split('\n')


def GroupbyDueDate(list):
	''' 
	This function groups task due dates in three lists depending on when they are due according to the current date (Overdue, Today and Tomorrow). Since the Today and Tomorrow due dates can be easily determined, in order to keep this script simple, checking for @done tasks in those dates is delegated to other parts of this workflow (i.e. "Fold Lines Containing..." action). However, completed tasks (i.e. lines with @done tag) in the past are filtered out from the Overdue list in order to keep that list short and optimized.
	''' 

	tdy = datetime.date.today() #gets today's date
	trw = tdy + datetime.timedelta(days=1)


	# These lists are global and used in the main program and some functions.
	overdueLst = []
	todayLst = [str(tdy.isoformat())]
	tomorrowLst = [str(trw.isoformat())]

	reDue = re.compile('.*@due\((....\-..\-..)\).*') # date in group 1
	reDone = re.compile('.*@done.*')
	
	for line in list:

		dueDt = re.search(reDue, line)
		done = re.search(reDone, line)
		
		if dueDt and not done:
			dueDtlst = dueDt.group(1).split('-') # Takes group 1 of dueDt (which is the date string found), splits it and puts it in a list
			dueDtdte = datetime.date(int(dueDtlst[0]), int(dueDtlst[1]), int(dueDtlst[2]))
			dtDif = dueDtdte-tdy

			if dtDif.days<0:
				if dueDt.group(1) not in overdueLst:
					overdueLst.append(dueDt.group(1))


	#Swap the "#" sign between the two lines below to include/exclude tasks due tomorrow.
	#completeList = overdueLst + todayLst + tomorrowLst
	completeList = overdueLst + todayLst
	regexString = '|'.join(completeList)
	return regexString
	
	
if __name__ == "__main__":

	action_out = GroupbyDueDate(mainList)
	workflow.set_output(action_out)
Show Lines with Overdue/Today Due Dates, @Today Tag and Project Names ?
  • Regular Expression
  • Case-insensitive Search (A = a)
  • Case-sensitive Search (A ≠ a)
^.*\:$|@today|@due\(Input\)
Invert
ON
Fold Lines with Tasks Done. ?
  • Regular Expression
  • Case-insensitive Search (A = a)
  • Case-sensitive Search (A ≠ a)
@done.*?
Invert
OFF
Move Caret ?
Direction
  • Backward
  • Forward
  • Start/End of Document
  • Start/End of Line
  • Number of Characters:
1