When a molecular scene contains many files, a small search task can become surprisingly distracting: locate a file by name, check whether it is selected, or narrow the view to files that are not selected. SAMSON’s Node Specification Language (NSL) gives you a concise way to express these checks with the file attribute space.
The key detail is that file queries match file nodes only. The short name for this attribute space is fi, so expressions such as fi.n "A" apply to file nodes rather than every kind of node in the scene. That boundary helps make a query more intentional: you can search the file-level part of a project without confusing it with similarly named molecular or structural nodes.
Start with a name
File nodes inherit the name attribute from the general node attribute space. You can refer to it as name or use its short name, n. The documentation gives these examples:
|
1 2 |
fi.n "A" fi.n "L*" |
Use a quoted string as the value. The first example is a compact way to express a name-based search for A; the second shows a pattern-style value, L*. If you are unsure which expression is appropriate for your naming scheme, begin with a specific name and then try the documented pattern form.
Check selection explicitly
Selection is another inherited node attribute. For file nodes, the attribute is written as selected, but it does not have the short name s used in the node attribute space. For example:
|
1 2 |
fi.selected not fi.selected |
The first expression checks for selected file nodes; adding not expresses the opposite condition. This is useful when you want to inspect the two sides of a selection state separately instead of relying on visual scanning alone. In particular, if you are reviewing a set of files after making selections, a negative query can help you focus on the files that are not currently selected.
Use the selection flag when that is what you need
File nodes also inherit selectionFlag, with the short name sf. It accepts true or false, and the documentation shows both explicit and abbreviated forms:
|
1 2 |
fi.sf false fi.sf |
These are two ways to write a selection-flag query: one specifies the value, while the other uses the attribute by itself. Keep the names distinct in your expressions: selected and selectionFlag are separate attributes in the reference. When you need a particular condition, writing the attribute you mean makes the query easier to read and revisit later.
A practical query-building habit
For a reliable workflow, build the expression in small steps. First narrow the search to file nodes with the fi prefix. Next add a name condition, such as fi.n "A". Then add a selection condition only if it is relevant, using fi.selected, not fi.selected, or the documented fi.sf form. Keeping each part recognizable makes it easier to spot a typo and understand what a saved expression is intended to find.
These attributes are especially useful when the problem is not molecular chemistry itself, but keeping a busy project organized: locating a file by its name, checking selection state, or expressing a file-only query instead of searching the entire node collection. For the complete attribute reference and additional context, see the SAMSON file attributes documentation.
Note: SAMSON and all SAMSON Extensions are free for non-commercial use. Get SAMSON.
