|
grandMA3 ユーザマニュアル » プラグイン » Lua 関数 - Object-Free API » GetPathType(handle[, integer])
|
Version 2.2 |
GetPathType 関数は、パスタイプの名前を含む文字列を返します。この関数は、オブジェクトをインポートするときに役立ちます。
最初のマクロ・オブジェクトのパスタイプ名(存在する場合)を出力します。
Lua |
return function () -- Get a handle to the first Macro. local myMacro = DataPool().Macros[1] if myMacro == nil then ErrPrintf("An error occurred, possibly because the first macro does not exist.") ErrPrintf("Please create one and try again.") return end -- Get the user name of the path type. local myPathTypeNameUser = GetPathType(myMacro, Enums.PathContentType.User) if myPathTypeNameUser ~= nil then Printf("The user name of the path type is: " .. myPathTypeNameUser) else ErrPrintf("There was an error getting the path type.") end -- Get the system name of the path type. local myPathTypeNameSystem = GetPathType(myMacro, Enums.PathContentType.System) if myPathTypeNameSystem ~= nil then Printf("The system name of the path type is: " .. myPathTypeNameSystem) else ErrPrintf("There was an error getting the path type.") end end |