ObjectList(string[, table])

grandMA3 ユーザマニュアル » プラグイン » Lua 関数 - Object-Free API » ObjectList(string[, table]) Version 2.1

説明

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

引数

戻り値

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", {reverse_order=true})
-- 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

This example creates an object list with the selected sequence. It then dumps all information about the sequence using the Dump function.

Dump()

The Dump() function returns a string with information about the object, for instance, the name, class, path of the object, its properties, and children.

Learn more in the Dump() topic.

Lua
return function()
-- Create a list of one handle to the selected sequence and store it to a table.
local myObjects = ObjectList("Sequence", {selected_as_default=true})
-- If the selection returned a table, then dump the first (and only) element.
if myObjects~= nil then
myObjects[1]:Dump()
else
ErrPrintf("An error occured.")
end
end