I’ve attached a file which demonstrates the problem I am trying to solve. Briefly, I am adding smart adornments within an agent. I’m collecting key ideas in a book by chapter and paragraph and want to view them within the agent map. For the agent query everything works fine as long as I hard code the chapter number to test for. I was hoping to be able to use the $ChapterNumber of the adornment itself as the predicate with the help of the ‘that’ designator. This doesn’t work. I have seen: ATbref ( that ) and assumed I could make the same assumption about an AgentQuery … The AgentQuery for the ‘Chapter 4’ adornment is what I think should work. Is it possible to reference a property of smart adornment within the agent query itself?
Works for me using it in the $AgentQuery of the Chapter 4 adornment in your test document.
To save having to set $ChapterNumber for the adornment, you could more easily use:
$Name(adornment)==$ChapterNumber
The that designator is normally used in a different context:
The designator 'that ’ refers to note running a query within find() code.
Note that the find() operator is not used in an agent and even if you could you already have agent for this precise purpose, with adornment doing the same for a smart adornment.
The list is comprehensive and I absolutely missed the references. However, I was already quite a way down the road with ‘this’ and ‘that’. Perhaps the designator documentation can be enhanced by grouping designators that refer to oneself vs. notes relative to oneself ?
I don’t think it really breaks down like that. Everything relates to the current selected note, or if looping in an action the current note, i.e. this. Designators normally report a note offset from the current note. Thus previousSibling reports the note with an $OutlineOrder one place lower than the current note, unless the current note is the first sibling in its parent container.
Then there are 4 exception:
agent. For aliases ‘inside’ an agent, this allows their rules, edicts, stamps, etc. to access the agent’s attribute values.
adornment. For aliases ‘inside’ an agent, this allows their rules, edicts, stamps, etc. to access the adornment’s attribute values.
that. Where a query is being run in a find() this allows the queried notes to access the query’s host note (i.e. the one running the query) to access the calling note’s attribute values (as opposed to the being-queried note).
current. This relates to some complex export scenarios and is not much encountered.
The above can also nest other designators. So for an alias in, for example an agent:
$Name(parent) is the same as $Name(agent). It is the title of the agent.
$Name(parent(original)) is the title of the parent note of the alias’ original note.