Page tree
Skip to end of metadata
Go to start of metadata

findLayers(recursive, nameOrFilterFunction)

Description

Function to find layers in the specified layer. For example, this.parent specifies the parent layer of the script module as the layer to be searched in. If recursive is set to true, sublayers will also be searched. The function returns an array with the Layer objects of the found layers. Particular layers can be searched by name or through a filter function. If searching by name, findLayers accepts only the Layer objects that match the specified name. The filter function uses the Layer object of each layer as argument. Only those Layer objects that return true for the search criteria defined in the filter function will be accepted by findLayers. Without a name or filter function the Layer objects of all layers in the searched layers will be returned.

Available in: Controller, Processor.

Arguments

recursiveIf set to false, only the current layer will be searched. If set to true, sublayers will also be searched. The default is false.boolean
nameOrFilterFunctionThe name of the layers searched for or a filter function. Only the Layer objects that match the name or return true for the search criteria of the filter function will be accepted. Set this to nil to deactivate any name filter or search criteria.string or function, optional

Return Values

Returns an array with the Layer objects of the found layers. Returns an empty table if no layers are found.

Example

3 Comments

    1. Please reread. Thanks!