Hi–I’m in a muddle about several things, mostly agents and getting info within a note’s hierarchy. I’ve read the TBX documentation wiki and “The Tinderbox Way” as carefully as possible and experimented with so many things–parent, this, that, $Text, $Name, and various syntax possibilities–apparently, ‘parent.$Text.contains(“foo”)’ doesn’t work.
Here’s my situation. I’m doing a second draft on an article about the Beatles, especially their 3 months in Hamburg. I’ve mentally cut the first draft into strips of text and summarized each text unit as a single note.
For example, the note about their terrible lodgings in Hamburg has $Name set to “05 Hamb living conditions”. This note’s $Text is “adversity, determination, overcoming”–which are three topics that this note belongs to. And all these notes are inside the container/note “Beatles M2 WC *5/15”.
Here’s what I’d like to do. I’d like to create an agent–one that is in the same window/container as the notes themselves–that finds every note that contains the text “adversity” in its $Text field.
Here’s one of the many queries I’ve tried to accomplish this:
inside("Beatles M2 WC *5/15") & $Text.contains("adversity")
Q1: This doesn’t work. What should this be instead?
So, I’m going to be doing this several times, and it’s irritating to need to go into the code–whatever code it is that works–and change the text to be matched. Ideally, I would like to create an agent called, for example, “adversity”, and have the aliases of the desired notes inside it–i.e., the same results as the situation I described above. So:
Q2: How should the query code of Q1 be changed to do this?
Getting an agent to do what I’ve described is key to being productive with this “Beatles” container/note (which is within a much bigger TBX file)–and with other TBX documents I will write in the future.
Help me, Obi-Wan Kenobi, you’re my only hope.