Function to find children in the specified Element object. For example,
this.parent specifies the parent layer of the script module as the Element object to be searched in. If recursive is set to
true, subelements will also be searched. The function returns an array with the Element objects of the found children. Particular children can be searched by name or through a filter function. If searching by name, findChildren accepts only the Element objects that match the specified name. The filter function uses the Element object of each child as argument. Only those Element objects that return
true for the search criteria defined in the filter function will be accepted by findChildren. Without a name or filter function the Element objects of all children in the searched Element object will be returned.
Available in: Controller, Processor.
|recursive||If set to |
false, only the current container specified Element object will be searched. If set to
true, subcontainers subelements will also be searched. The default is
|nameOrFilterFunction||The name of the children searched for or a filter function. Only the Element 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|
Returns an array with the Element objects of the found children. Returns an empty table if no children are found.
-- find the MIDI module with the name "Lua Script" and print its type
scriptModules = this.parent:findChildren(false, "Lua Script")
if scriptModules then
-- find all children and print their names
children = this.program:findChildren(true)
if children then
for i, child in ipairs(children) do
print("Could not find any children!")