I would like to keep a dynamic list of my 15 most recently modified notes I have recently been working on in the document. Ideally, this would be a list in the text of a note.
I realize I could easily sort in the attribute browser by $Modified, however I would like to keep a note at the top of a document to easily see my most recent work especially since I tend to use many different .tbx documents.
Thanks Bernard-o. This is a start. I am worried about going down the path of agents because over time, I already use a lot of agents and depending how large the documents get, I want to avoid sluggishness. Therefore, I was hoping to use an edict with a collect_if operator. Just to get a list that I could see in $Text.
For me, this recently used list can be applied to not only my recent notes, but also recent $Tags, but for now just getting a list of my top 10-15 notes would be helpful.
My issue, with using collect_if or collect or find(), besides my inexperience with using them is how do I limit the result to the top 10 or 15. I do not see where there is an option to specify how many values you want. Sort of stuck here.
A recently used list is my initial stab at āinformational gardeningā. Something I have tried in the past, but have not been very good at over time. At least by revisiting recent notes, I can somewhat understand what my context was when I last opened the document. For some it might be days, but others it might be weeks to months. I think of these notes as contextual breadcrumbs.
For a stamp or edict approach (same code, just more or less control over how often it runs) you can:
find() all notes with a $Modified valueā ā”.
sort on $Modified, reversed, i.e. most recent first.
pass to a String, via .format('\n").
this allows us to ask for .paragraphs(15). This is needed as you canāt use List.at() to get a range of list items.
Another approach would be
find() all notes with a $Modified value.
loop using List.each(), with a loop variable.
for loop items 1-15 concatenate the notes to $Text with a line break after each item.
Note: find() returns paths. do you want the $Path or the $Name of your ārecentā note in the text.
Hopefully this helps. If not enough detail to code for yourself just ask.
ā . This really collects too many items. If you can you should add extra query parameters to limit the number of items in the scope of the search. A trival example is you donāt want to search prototypes and templates, so if all you main data in under one container (e.g. āDATAā), start with a scope restricting query term like descendedFrom("DATA").
ā”. You likely want to exclude notes like the one listing recent items from the search as it will have been modified recently!
Thank you Mark, the part where I have been getting stuck is finding out how to just limit the list to 10 or 15 items. I am hitting the edges of my Tinderbox scripting experience with this example but that is a good thing.
I will study your 2 suggestions and see what I come up with this week.
@eastgate, I think this should work, but it is not. I created the first agent and sorted it by $Modified. In the second agent, I search the first agent for $SiblingOrder<=5. I would think that this should give me the first five siblings, but Iām getting more. What am I doing wrong?
Actually, I donāt think so. I donāt want the original notes, but rather the aliases in the first agent. If I did original that would not drive the desired result as original may not be sorted by $Modified.
Ahā¦yesā¦I see the sibling order is related to the actual original notes, not the results of the search. Makes sense. Anyway, the āfirst()ā method is SOOOOO much cleaner.
Many thanks MarkB and Michael. Like many things Tinderbox, I had not known or ever before used the first() operator or known about $SiblingOrder because I had not needed them before. I feel I have been learning so much in the past few months especially, by pushing my boundaries and working through these issues in the forum. Understanding is sometimes much more deliberate than we would like, however it is broadening my abilities to use tinderbox. Thank you.
Will begin implementing first() with my notes, tags and keywords to drive better contextual understanding especially when I revisit my notes.
I am intrigued about simulating your dashboards as āTo resurface notesā described here.
Thank you both. I think I am good for now. Have a great week.
Tom