Find the note you need: a practical guide to NSL note attributes

Notes can be easy to overlook when a molecular scene gets busy. You may want to identify a note by its name, find notes that are currently visible, or check which ones are selected—without confusing those different properties. In SAMSON, the Node Specification Language (NSL) provides a compact way to describe criteria for matching note nodes.

This guide focuses on the note attribute space. Its short prefix is nt, and it matches only note nodes. That prefix is useful context: it makes clear that a query is checking notes, rather than applying the same attribute to every kind of node in the document.

Start with the note’s name

If you are trying to locate a particular note, the name attribute is a natural place to start. Its short name is n, and values are written in quotes:

  • nt.n "A"
  • nt.n "L*"

The second expression is an example shown in the reference. When building a query around a name, keep the value in quotes, as in these examples. This is especially helpful when you are checking a note by its label rather than by its display state.

Separate visibility from visibility flags

For visibility-related checks, the note attribute space offers both visible (short name v) and visibilityFlag (short name vf). The reference lists examples for each:

  • nt.v and not nt.v
  • nt.vf and nt.vf false

These are distinct attributes, so it is useful to be precise about which one your question concerns. For example, if you want to match notes by the visible attribute, use nt.v; if you want to check the visibility flag, use nt.vf. The page identifies both as inherited from the node attribute space, where their definitions are documented.

Keep selection state distinct

Selection has a similar pair of attributes: selected and selectionFlag. The note reference shows nt.selected and not nt.selected for the first, and nt.sf or nt.sf false for the second. One detail is easy to miss: selected has no short name in the note attribute space. In particular, the reference does not list nt.s as its shorthand. For the flag, the short name is sf.

A small checklist for writing note queries

  1. Begin with nt to target note nodes.
  2. Choose the attribute that matches your intent: name, visible, hidden, selected, or one of the corresponding flags.
  3. Use the documented short name when it is available: n, v, vf, h, or sf.
  4. For a negative boolean check, follow the documented form, such as not nt.v.

For instance, if you are troubleshooting why a note is hard to find, you can inspect its name with nt.n "A" and check its visible attribute with nt.v or not nt.v. Treat these as separate questions: the name identifies a note by a string, while the visibility and selection attributes describe other aspects of the node. This distinction helps keep queries readable and makes it easier to spot when you have checked the wrong property.

The note attributes listed here are inherited from the broader node attribute space. For their detailed definitions and the complete reference, see the SAMSON note attributes documentation.

Note: SAMSON and all SAMSON Extensions are free for non-commercial use. Get SAMSON.

Comments are closed.