When a molecular scene gets busy, a small note can be surprisingly hard to find. Notes may sit alongside many other node types, and a broad search can return more than you intended. In SAMSON’s Node Specification Language (NSL), the note attribute space gives you a way to describe note nodes specifically, then narrow the match using attributes such as name, visibility, and selection state.
The key starting point is the nt prefix. It identifies the note attribute space, which matches only note nodes. That makes nt useful when your task is note-focused: rather than asking for nodes with a particular property in general, you can write an expression that explicitly targets notes.
Start with a note-specific filter
For example, nt.v is the documented short form for matching visible notes, while not nt.v matches notes that are not visible. These expressions are useful when you are trying to narrow attention to notes in a particular display state. The complementary nt.h and not nt.h expressions filter by the hidden attribute.
Although “hidden” and “visible” may sound like two ways to say the same thing, NSL lists them as separate attributes. Treat them as separate criteria in your expression rather than assuming one is simply the inverse of the other. The same caution applies to selected and selectionFlag, or to visible and visibilityFlag: each has its own entry in the attribute space.
Use names to narrow the results
If the note has a useful name, add a name condition. The full attribute name is name, and its short form is n. The documentation shows expressions such as nt.n "A" and nt.n "L*". The name value is written in quotes. This can help distinguish a particular named note from other notes while keeping the expression scoped to notes.
For instance, if you are trying to inspect notes named “A” that are visible, you can combine the documented name and visibility conditions: nt.n "A" nt.v. If you instead want to focus on notes that are not visible, use not nt.v as the visibility condition. These examples illustrate the useful habit: first specify the node category with nt, then add the property that addresses the task in front of you.
Know which short names are available
Most of the attributes listed for notes are inherited from the general node attribute space. The short forms include h for hidden, n for name, sf for selectionFlag, vf for visibilityFlag, and v for visible. The selected attribute is a notable exception: for notes, it has no short name. Write it in full, as in nt.selected or not nt.selected.
This distinction is handy when an expression does not behave as expected. Check both the attribute name and whether a short form is actually listed for notes. In particular, do not assume that the short form used for a general node attribute is available in every specialized attribute space.
A simple way to build a filter
When composing a note query, work from broad to specific: use nt to keep the match limited to notes, add a name condition if you know the note’s name, and then include the relevant state such as visibility or selection. Keeping each condition explicit makes the expression easier to read and easier to adjust later. It also helps prevent a common source of confusion: mixing up an attribute’s state with a similarly named flag.
The note attribute reference lists the available names, short names, values, and examples. For the full reference, see SAMSON’s NSL note attributes documentation.
Note: SAMSON and all SAMSON Extensions are free for non-commercial use. Get SAMSON.
