| grandMA3 ユーザマニュアル » プラグイン » Lua 関数 - Object API » Get(handle, string[, integer]) | Version 2.2 |
Get 関数は、オブジェクトの名前、クラス、パスなど、指定されたプロパティに関する情報を含む文字列を返します。
この例では、選択したシーケンスの Tracking プロパティに関する情報を出力します。
Lua |
return function () -- SelectedSequence() creates a handle to the selected sequence. local selectedSequence = SelectedSequence() -- Check if there is a selected sequence. If not, then exit the function. if selectedSequence == nil then ErrPrintf("The selected sequence could not be found.") return end -- Set a variable with the property name. local propertyName = "Tracking" -- Get the value of the property. local propertyValue = selectedSequence:Get(propertyName) local propertyValueString = selectedSequence:Get(propertyName, Enums.Roles.Edit) -- Return some feedback. if propertyValue ~= nil then Printf("The selected sequence's property " .. propertyName.. " has the value '" .. propertyValue .. "' and a string value of '" .. propertyValueString .. "'.") else ErrPrintf("The property could not be found.") end end |