| grandMA3 ユーザマニュアル » プラグイン » Lua 関数 - Object-Free API » ObjectList(string[, table]) | Version 2.2 |
ObjectList 関数は、ハンドル付きのテーブルを返します。このテーブルは、選択範囲を作成するための文字列入力に基づいて作成されます。
この例では、フィクスチャ1〜10の名前とパッチアドレスを返します。フィクスチャが存在しない場合は、エラーテキストを返します。
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 |
この例では、選択したシーケンスを含むオブジェクト・リストを作成します。そして、シーケンスに関するすべての情報を Dump() 関数で出力します。
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 |