I have tasks to which I haven’t bothered to add dates.
So how do I create an agent which will filter all open tasks?
I have tasks to which I haven’t bothered to add dates.
So how do I create an agent which will filter all open tasks?
Too broad a question as we need a bit more info:
oh okay.
I just created a note and then set the prototype to tasks. Now I need to filter all these tasks protype using an agent. Hope I am more clear?
Adding the screenshot if it is still not clear.
Ok, so we now know you are using the built-in prototype ‘Task’.
That helps because when a note uses a prototype, the name of the prototype is stored in the note’s $Prototype attribute.
If we inspect Get Info for note ‘xx’ and look at $Prototype:
We see $ Prototype has the value Task
. Therefore we know this is true for all notes using the ‘Task’ prototype. This makes it easy to write a query:
$Prototype=="Task"
An agent using the query above will find all notes using the ‘Task’ prototype. But that is all Task notes. Let’s assume—as you don’t define your method—that an open task is one with no due date. In other words, the value of $DueDate is "never"
†. Now we can improve our query to find only those task notes with no due date:
$Prototype=="Task" & $DueDate
Notice we test for the prototype first because there will be fewer matches to the Task prototype than notes with no due date set.
Hopefully that gives you enough to find the desired notes.
As a general pattern, agent queries in involve one or more query terms (in the last above there are two terms) that test some combination of a note’s:
So going back to your original question “How do I create an agent which will filter all open tasks?”, the way to help yourself is to ask it like this: “What defines a Task note?” and “What defines an open Task note”. Using the latter approach will help you spot the likely query terms you need.
†. Why “never”? this is the default value for all Date-type attributes with no value set.
Woah! You rock!
Thanks for your patience
No problem.
Also, sorry for a long answer, but I figure giving the background thinking would help you and others get a head start on other queries too!