When creating a certain class of notes (e.g., a task-note), I’d like to invoke a script that makes an alias of the selected note and stores the alias in a collection-note, typically at the root of my TBX file.
In the past, I employed an agent as my collection vessel. The agent prowls my TBX file in search of notes that match the query (e.g., $Prototype == "_Task"
).
The appeal of a script over an agent include:
a. Less CPU-intensive. Task-notes occur virtually anywhere in my TBX file. The scope of the agent’s search cannot be narrowed (in my use-case). A script, on the other hand, is a once-and-done affair.
b. Because the collection-note is not an agent, I can make notes inside the collection-note. Processing or surveying a list of tasks usually triggers more tasks that need attention. The new tasks could be made on the spot.
The script would do the following:
- change the prototype of the task to
_Task
- create an alias
- move alias to collection-note
The script is triggered on every task-note when it is created. This manual step could be viewed as a drawback: what if one forgets? However, a manual step seems unavoidable. A note has to be ‘marked’ as a task in some manner regardless of whether a script or an agent is ultimately employed. For example, I presently use a stamp[^1] to change prototype to _Task
(Step 1). I would simply invoke a script instead of a stamp.
[^1]: my understanding is that stamps can change/set attributes of selected note(s) but cannot make aliases.