Editorial Worklfows for Regex Matching Past and Today's Date

I really like how TaskPaper 3 is aware of dates and allows for relative date queries, such as the following shared by @macdrifter for finding all available items with start dates on today or in the past.

Available @search(@today or @start <[d] today)

I found myself wanting this on iOS, so I’ve cobbled together some python and regex to achieve it in Editorial.

Here is an ingredient Editorial workflow that generates a regex to match all lines containing @start(yyyy-mm-dd) tags for today’s date and all dates before today (stored in two different workflow variables respectively). The python scripts have an option up top to change “start” to some other tag like “due” to match due date tags.


Here are two workflows that use these variables.

This first workflow shows a popover of all tasks tagged with today or past start dates. Tapping on an item takes you to that item in the document and highlights the task.


The second folds all lines except those with start tags today or in the past (similar to @macdrifter’s Available search above). It also leaves project titles unfolded so you have those for reference. This one could be improved by not showing projects headers that do not contain available tasks and also showing descendants of available tasks like indented notes or subtasks on the following line(s), but I haven’t yet been able to figure those things out. I’ll keep trying, but maybe someone else could work that out.


Note: These workflows only work for dates between 2000-01-01 and 2029-12-31. Hopefully, scheduling 15 years out is not a significant need. :grin:


Whoops. Looks like I misnamed the sub-workflow reference in the last two scripts. I fixed this, and they are now updated with the correct reference to the ingredient workflow.