GetPath(string[, boolean] | integer)

grandMA3 ユーザマニュアル » プラグイン » Lua 関数 - Object-Free API » GetPath(string[, boolean] | integer) Version 2.2

説明

The GetPath Lua function returns a string with the path of a grandMA3 folder.

The function has two possible argument types - use one of them with each function call.

引数

  • string:
    A text string with the folder name.
  • boolean(optional with string):
    If this boolean is true, then the folder at the path is created if it does not exist.

    - OR -
  • integer:
    An integer identifying an index in the "Enum.PathType" table.
制限
Folder creation only works with string arguments.

戻り値

  • string:
    The returned string is the first found full path related to the provided argument.

This example prints the paths of the show folder on the system monitor twice. It demonstrates the two different input types:

Lua
return function()
-- This prints a path based on a string input and it creates the folder if it does not exists.
Printf("Path of show files (string) is: " .. GetPath("shows", true))
-- This prints the path based on an integer. The integer is looked-up using the 'PathType' enum.
Printf("Path of show files (integer) is: " .. GetPath(Enums.PathType.Showfiles))
end