Filter by date then sort by tag


Varieties of this question have been asked before I think but not in this form so I created a new topic, Apologies for possible overlaps.

I have saved searches for my tasks for every day of the week so that I can quickly see what’s on my plate for any given day. What I would love to do is be able to sort the tasks for a given day further by non-date tags (for instance @mail, @writing, @reading, @discuss etc); this way I can more easily plan my day in blocks since tasks of a certain type are all grouped together.

This is the kind of thing that is possible with agenda views in emacs + orgmode. I have been experimenting a bit with emacs already but wonder if this could be somehow scripted?


Sorting is the tricky part… TaskPaper doesn’t support sorted views directly. With a script your options are:

  1. You could write a script to sort your view in place… but that means it stays sorted, so you can’t go back to your original order.

  2. You could write a script to generate a new sorted view by copying items out of your existing document. Then the new view is sorted, and original view is left as is. But now you have two views, so they won’t sync. I don’t know to much about org-mode… but I just read a paragraph about Agenda views in org-mode and it says they are (read only, in separate buffer) which sounds a lot like what I’m describing in case 2 here.


If you have some experience with Emacs, you can give the TaskPaper mode for Emacs a try. It has an Agenda view, very similar to Org Agenda view, but works with TaskPaper files.


Thanks a lot for both replies.

@jessegrosjean use case 2 is indeed what agenda views in orgmode do.

@saf-dmitry I just discovered TP mode and it looks good; I have some trouble getting the agenda view to work but still getting used to emacs… would you mind if I DM for some help getting it going?


@gerbenzaagsma If you need help with TP mode, just DM me.


Are there any examples of scripts that do something like @jessegrosjean 's No. 2 above?

I want to write a script that filters and sorts my tasks and dumps them into a new (temporary) TaskPaper document. Despite a decent amount of experience with Python, I’ve never managed to write a successful JXA script. I’m hoping a simple example like the above would help me get going…