WARNING: The [sjs-3] engine was deprecated, use [sjs-4] instead.

Collection.prototype.select()

Find a file specified by its path relative to the files in the collection, return the first match.

Syntax

collection.select(selector string) File collection.select(selector string) null

Parameters

selector string

A path and any filters. Selectors that may match multiple files, like the child selector, are invalid. See selectors for more details.

Examples

Can’t select files relative to an empty collection.

Basic example.

Returns the first match.

Example when no match is found.

It is invalid to use selectors that may match multiple files.