説明
GetPathOverrideFor 関数は、grandMA3 フォルダのパスを示す文字列を返します。これは、卓に接続されたリムーバブルドライブ上にパスがある場合に有効です。
引数
- string:
フォルダ名を含む文字列です。
- string:
文字列形式のベースパスです。
- boolean (文字列の場合のオプション):
true の場合、パスにフォルダが存在しないときに作成されます。
― または ―
- integer:
"Enum.PathType" テーブル内のインデックスを識別する整数です。
- string:
文字列形式のベースパスです。
- boolean:
true の場合、パスにフォルダが存在しないときに作成されます。
戻り値
- string:
返される文字列は、指定された引数で最初に見つかったフルパスです。
例
この例では、マクロ・フォルダのオーバーライドパスを System Monitor に出力します。これは、リムーバブルドライブが接続された卓で実行する必要があります。
|
return function () local myBasePath = nil for _, value in ipairs(Root().Temp.DriveCollect) do local driveType = value.drivetype if driveType == "Removeable" then myBasePath = value.path break end end if myBasePath == nil then ErrPrintf("No removeable drive could be found. Please insert one and try again") return end
local myPathType = Enums.PathType.UserMacros
local myOverridePath = GetPathOverrideFor(myPathType, myBasePath) Printf("The path is: " .. myOverridePath) end |