When a molecular project contains several imported structures, trajectories, or other file nodes, finding the one you need can become a small but persistent source of friction. You may remember part of its name, want to distinguish selected from unselected files, or need to check a file’s selection flag. SAMSON’s Node Specification Language (NSL) provides a compact way to describe those matches.
This guide focuses on the file attribute space. Its short name is fi, and expressions in this space match file nodes only. That scope matters: a query such as fi.n "A" is about file nodes whose name matches the expression, rather than every kind of node in the molecular scene.
Start with a name
The name attribute has the short name n. Put the value in quotes, as in fi.n "A". If you are looking for a name pattern rather than a single letter, the documentation also shows fi.n "L*". These examples are useful when you want to express a name-based match directly instead of relying only on visual inspection of a crowded workspace.
A practical habit is to begin with the clearest part of the file name you remember, then refine the expression if the result is broader than intended. For example, the documented "L*" pattern can help express a group of names beginning with L. If you need a particular file, check the returned matches rather than assuming a short pattern is unique.
Check selection state explicitly
File nodes inherit the selected attribute from the node attribute space. In the file space, use fi.selected to match selected file nodes and not fi.selected to match file nodes that are not selected. The file reference specifically notes that selected does not use the short name s here, so write the full attribute name.
This is useful when you want a query to reflect the current selection rather than a name. For instance, if you are checking which file nodes are currently selected, fi.selected states that intent plainly. If you want the opposite group, use not fi.selected. Keeping the selection condition visible in the expression also makes it easier to understand later why a match was included.
Use the selection flag when that is what you mean
The selectionFlag attribute is also inherited from the node space. Its short name is sf, and the file examples include both fi.sf and fi.sf false. The first is a concise way to test the flag as true; the second explicitly asks for a false value.
selected and selectionFlag are separate attributes in the reference, so avoid treating their names as interchangeable. Choose the one that matches the condition you intend to query. When writing or sharing an expression, using fi.selectionFlag instead of fi.sf can make the purpose easier to read, while the short form is convenient once you recognize it.
A simple way to build a reliable query
- Limit the scope: start with
fiwhen you mean file nodes. - Add an identifying name: use
fi.n "A"or a suitable pattern such as the documentedfi.n "L*". - Add a state condition only when needed: use
fi.selected,not fi.selected,fi.sf, orfi.sf false. - Review the matches: especially when using a short name or pattern, confirm the results are the files you had in mind.
The payoff is not a more complicated workflow; it is a clearer one. A short NSL expression can make the criteria for finding file nodes explicit, which is helpful when you revisit a project or need to communicate how you located a particular set of files.
For the full list of file attributes and examples, see the SAMSON file attribute reference.
Note: SAMSON and all SAMSON Extensions are free for non-commercial use. Get SAMSON.
