Find the Right Files Before Your Molecular Workspace Gets Crowded

When a molecular project contains many imported files, it can be easy to lose track of which file nodes you need to inspect or work with. The file attribute space in SAMSON’s Node Specification Language (NSL) offers a compact way to describe file nodes by name or selection state. Knowing which attributes belong to this space—and which are inherited—helps make a query clearer and avoids mixing up a file node with other kinds of nodes.

Start with the file attribute space

File attributes use the prefix fi. This matters: an expression beginning with fi is scoped to file nodes, rather than being a general search across every node type. For example, fi.n "A" uses the short name n for the file’s name attribute. The documented example fi.n "L*" shows another name expression you can use when looking for files whose names fit that pattern.

This is useful when a project’s file names carry practical clues—perhaps a short label identifies a structure or a group of imported items. Instead of relying on memory or scanning a long list manually, you can express the name you want to find. Keep the expression focused on the file node: fi.n refers to its name attribute, not to a molecular structure’s internal contents.

Check selection state explicitly

The file attribute space also includes selected and selectionFlag. These are both Boolean attributes, but they have different names and different syntax in the reference:

  • fi.selected checks the selected attribute. To express its opposite, the documented example is not fi.selected.
  • fi.sf is the short form of selectionFlag. The examples include fi.sf and fi.sf false.

A small but important detail: the selected attribute has no short name in the file attribute space. Although the node attribute space has a short name for it, the file reference explicitly says that short name is not available here. So, when writing a file query, use fi.selected rather than assuming a shorter form will work.

The documentation lists both selection-related attributes as inherited from the node attribute space. It does not define them as interchangeable. If you are choosing between them, use the attribute that matches the state you intend to test, and consult the node attribute reference for the detailed meaning of each.

A practical way to build a query

When a query does not return what you expect, check it in a few steps:

  1. Confirm that you want to match file nodes. If so, use the fi prefix.
  2. Choose the attribute deliberately: n for a name, selected for the selected state, or sf for the selection flag.
  3. Use the value form shown in the reference. Names are written in quotes, while the Boolean examples use true or false.
  4. Keep the expression small while checking it. A simple name or state test is easier to understand than a query whose behavior is difficult to isolate.

For example, if you are trying to identify a file by its label, begin with fi.n "A". If the question is instead whether a file is selected, use fi.selected. These expressions answer different questions; choosing the right one can save time when sorting through a busy workspace.

For the full attribute table and the links to the inherited node definitions, see the SAMSON file attributes reference.

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

Comments are closed.