@done and subtasks

It would be nice™ if TaskPaper had some more intelligence for @done between a task and it’s subtasks.

For example, if I mark a task done, I would like TP to also mark that task’s subtasks, if any, as done. IOW, marking the task would be a shortcut way of marking all of the subtasks as done. (I realize we can select multiple tasks and mark them all at once; this would save us having to do the manual selection, and it treats tasks and their subtasks as a unit.)

Conversely, if I mark the last of the subtasks as Done, I would like TP to mark the parent task as Done, also.

E.g., in the sample below, if I mark ParentTask1 as done, I would it to also mark Subtask1-3 as done, with the same date as on ParentTask1.

And, if I mark Subtask5 as done, I would it to also mark ParentTask2 as done (with the same date as Subtask5, since that was the date the last subtask was done).

Project:

  • ParentTask1
    • Subtask1
    • Subtask2
    • Subtask3
  • ParentTask2
    • Subtask4 @done(2016-04-10)
    • Subtask5

Thanks! I really like TP; I’ve tried several “to do” programs over the years, and this is the first one that really fits how I work.

I believe that there is already something written in the “extensions” wiki that kind of does what you want. You should check it out!

Are you sure? I was actually just looking myself but couldn’t find what I wanted. So was just working on a script. But if there’s an existing script that would save some time :slight_smile:

I remembered something about it, but it was not exactly what he asked. The script below marks the project as done with a time-stamp once you finish the last task within the project… Maybe that can be used as a base.

I think the current default behavior for toggling tags is the simplest and best for built in behavior. But I’ve written a script that works the way that you want I think:

Once again, thank you very much for the work of putting a script together. Just two things.

One, I’ll disagree that the current default behavior is best. It certainly is simplest, but not best.

In an outline, a parent and child are the same family, i.e. one unit. If I move a parent, the children move with it, as they should.

Thus, the minute we add subtasks to a task, that task really isn’t a true task any longer, it’s the description of the subtasks beneath it. Because of that, I’ll argue (this one more time) that the behavior I’ve described is “best” — marking the parent means mark the entire unit, because the parent is a placeholder for the entire unit. And marking the final child means, by definition, that the entire set of tasks is done, and the placeholder for the entire set of tasks is the parent, which means the parent should be marked as done also.

Two, I have read the User’s Guide, but I still don’t understand how to generally run scripts within TP. It tells how to type a script in the Applescript editor and then run it, but how does that translate to using it within TP. (I also didn’t understand what the “Javascript context” section meant.) IOW, I take that script and save an Applescript file. But now what? Do I have to assign a shortcut key to it, or is there a way to run scripts generally within TP?

Thanks again!

This post gives some steps on running scripts:

http://support.foldingtext.com/t/how-do-i-run-install-a-script/1740

Perfect, although you’re too fast — I just said in my other post you could ignore that portion of this one. :slight_smile:

I’ll make a suggestion that you add the entire text of that post to the “Creating Scripts” portion of the User’s guide. I would never have thought to look here for those instructions, and they’re perfect, exactly what I was missing.

I agree with the functionality as proposed by taskinator, this being:

  1. When all subtasks are marked @done the corresponding task should also be marked @done as subtasks and task are linked and part of the same action
  2. If the task is marked @done then the subtasks by definition should be marked @done too
    Whether it’s default or a script I don’t mind.

In view of the above the current version of the script has a some flaws:

  1. The behaviour depends on the location of the cursor. If the cursor is located in a subtask and all subtasks are marked @done and I invoke the script, the task containing the subtasks is not marked @done even through all conditions are fulfilled to do so. Instead and confusingly the subtask status is toggled. Note if I move the cursor to the task containing the subtasks it works as above.

  2. If I mark a task as @done I usually get a date i.e. @done(2016-04-14) or similar. The date disappears if I toggle back and forth.

  3. I find toggling confusing. If all conditions are met the task + subtasks etc… should be marked @done by the script…period. If I change my mind I can always use “Undo” to revert to the prescript state.

Again the functionality requested by taskinator is very much what I would like to see. My comments are meant to be constructive and hopefully (fingers crossed) lead to an updated and improved script or functionality of TP.

I agree about the parent task being a container. If a parent is marked done, it would be nice if all children were also marked done. I disagree however about the last task. That assumes that your tasks are all sequential in nature. I may have two separate tasks under the same parent which both must be completed. Completing one doesn’t mean that the other should be completed.

Still love every aspect of TP though.

That wasn’t the request. In your scenario, I agree the second one shouldn’t be completed. The request was that when the second (last) child is completed, the parent should also be completed.

IOW, this is only a parent-child and child-parent thing, never a child-child thing. Completing one child does nothing to any other children.