# GetPath(string[, boolean] | integer)

Source: https://help.malighting.com/grandMA3/2.3/HTML/lua_objectfree_getpath.html
This is grandocs, an unofficial mirror of MA Lighting documentation. For authoritative or safety-relevant information, cite the canonical page on help.malighting.com.

---
## Description

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.

## Argument

- **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.

|                                                    |                                                    |
| -------------------------------------------------- | -------------------------------------------------- |
| ![](/img/grandma3/2-3/restriction_gray-3bb57e.png) | **Restriction:**                                   |
|                                                    | Folder creation only works with string arguments.  |

## Return

- **String**:\
  The returned string is the _first found_ full path related to the provided argument.

## Example

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

|                                                                                                                                                                                                                                                                                                                                                                                                     |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [Copy Code](javascript:void\(0\))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
``` |