DueDates Script for Taskpaper 3?


#1

Currently, I’m using TaskPaper 2 with the excellent DueDates script (http://www.hogbaysoftware.com/wiki/DueDates) and I would like to switch to taskpaper 3 in the future: It would be nice to have a javascript version of that script or some other solution/workaround - does anybody have something like that?


Script Error in TaskPaper 3
Script help: convert TP2 script to TP3
#2

Looking through the spec of that script, my impression is that its functions are now included in TaskPaper 3’s expanded query language (which includes date query), and saved searches.

Probably worth looking at sections 5 and 6 in this:

http://guide.taskpaper.com/

and experimenting with saved searches a bit, in TaskPaper 3 preview, to see if there is anything that you are are missing.

( In short, you may no longer need a script to do the same set of things. You could, for example, have a saved Today search based purely on @due tags, rather than having to get a script to add extra @today tags )


#3

I saw the natural-language-date support and I was able to use it in queries to simulate my current taskpaper 2 view. However, I would like to use a similar syntax to create ISO-dates, like converting @due{mon} to the next or even @due{mon:2} to the second next Monday from today. As far as I understand, I can only use the current date support in queries, not in creation - right?

Additionally, I also do use the @repeat-feature of the script, e.g. @repeat(monday:2) resets the @due-date to the next second Monday from today. I could live without that feature, though…

Thanks for your help,
k.


#4

I do plan to add ISO-date creation, just having decided how best to do it. In simplest case you could just select some text and issue a command convert-relative-date-to-absolute. So that would turn “next monday” into “2016-02-15”. Let me know if you’ve any ideas on better UI for this.


#5

Adding ISO-date creation would be great!

Concerning the UI: I don’t really like the need to mark text for conversion first. Would it be possible to have a nothing-selected-fallback that tries to convert all non-ISO due-tags? So that all tags like @due{next monday} (or even shorter @due{mon}) anywhere in the text are converted to @due{2016-02-15}?


#6

In the next preview release I’ll include api for converting a date string to a TaskPaper style ISO date. It will then be quick to write a script to search for and convert all @due tag relative dates to ISO dates. (Let me know if not quick for you and I can help). That can get you started working with the feature, later if it makes sense can decide how best to build it in.


#7

Sounds great - will try to get my workflow working!

Thanks,
k.


#8

Wow, that is just awesome


#9

Jesse’s new API will make these things much easier, but in the meanwhile, an interim Keyboard Maestro macro which translates informal date times (using TP3’s date language) when you close the final parenthesis on a tag in TaskPaper 3 Preview:


#10

(Minor update to ver 0.10 of the script above, using the new API in build 169)


#11

I finally found the time to try your script - this is really nice! I set up my workflow to switch to tp3 now and will try that in the next days!

Thanks again,
k.


#12

Are times on today’s date supported?

Starts today @search(* except //@start>[d] today)

  • starts today @start(2016-02-18)
  • starts today 9am (in the past) @start(2016-02-18 09:00)
  • starts today 9pm (in the future) @start(2016-02-18 21:00)

This saved search only shows the first line for me (when I run this at 11:25am, and the second line should be included).

What am I missing?


#13

I think the mapping is:

 `today` -> midnight at start of today

`2016-02-18` -> 2016-02-18 00:00

So line one is not excluded by your except clause (00:00 is not more that 00:00)

but the other two are excluded:

  • 09:00 > 00:00
  • 21:00 > 00:00

Perhaps your filter is really intended to exclude things which start beyond midnight (or end of office hours) ?

( or perhaps which start beyond the current value of the now keyword ?)


#14

@complexpoint Yes, the now keyword is exactly what I want. Thank you!


#15

@complexpoint Thank you for the awesome macro!


#16

I’m surprised I can’t find more discussion or instruction about workflow with recurring tasks. I also used to use DueDates, and that made sense. Now, it looks like I either have to setup tasks that recur, but cannot mark them as complete (unsatisfying, and no record of completion), or manually recreate them every time.

Regardless, I attempted setting up recurring tasks that I just wouldn’t make as complete. I took a big list of dated entries, many of which have today’s date. I can use something like @due(Wednesday) (assuming that means it will be due every Wednesday…today is Thursday), then I try to query for items due today. I tried:

@due = [d] today (shows nothing)
@due = [d] today (shows nothing)
@due <= [d] today (works correctly, but shows the task I set for Wednesday…apparently it shows tasks from earlier in the week)

I can’t figure out how to get just today’s tasks.

Are there any guides out for recurring workflows/recommendations?


#17

The thing to remember is that any dateTime value has a time as well as a day. If no time is shown, then its value is precisely midnight.

That means that the = operator is not likely to be what you want – it’s only going to find things that precisely, down to milliseconds, share the time as well as a day.

To match the period between the start and end of a calendar or working day, < and > are what you need. For example, from midnight precisely this morning, to a millisecond before midnight tonight:

@due >=[d] today and @due <[d] tomorrow

( and of course you can adjust that for a watershed at the start or end of the working day, rather than midnight)


#18

I wrote a primer some time ago. Read it and if you have some specific questions, just create a new post with the question and I or others will help you out.

Primer on using dates


#19

That helped. Thanks. With DueDates, I had a clean slate at the end of the day. With this method, recurring items just have to stay there in the “today” query. Maybe a script that just duplicates items in the archive tagged @recurring and resets their status. That would solve it. You check off tasks as you finish them, they go into the archive, then you run the script every morning and get fresh tasks. I’m going to look into this.


#20

Should not be too difficult, I think, to write something for TaskPaper 3 which uses the same @repeat tag format as that earlier script, and creates or updates @due dates in tasks which:

  • have a @repeat(unit:n) tag,
  • and are marked @done,
  • or don’t yet have a @due tag.

Is that more or less the spec ?

Something to be run intermittently from Hazel, or manually launched as an update script ?