grandMA3 User Manual Publication

ObjectList(string)

Description

The ObjectList Lua function returns a table with handles. The table is created based on a string input that should create a selection.

Argument

  • String:
    The string must be a command that would create a range of objects in the command line.

Return

  • Table:
    The function returns a table with handles to the objects based on the string argument.

Example

This example returns the names and patch addresses of fixtures 1 through 10. It assumes these fixtures exist - if they do not, then it returns an error text.

Lua
return function()
-- Create a list of handles based on the "Fixture 1 Thru 10" selection and store it in a table.
local myObjects = ObjectList("Fixture 1 Thru 10")
-- If the selection returned a table, then go through all elements and print information of the object.
if myObjects~= nil then
for i in pairs(myObjects) do
Printf("Fixture: " .. myObjects[i].name .. " - Patch: " ..myObjects[i].patch)
end
else
ErrPrintf("An error occured. Does Fixture 1 Thru 10 exist?")
end
end