-
-
Notifications
You must be signed in to change notification settings - Fork 5
GetPathOverrideFor
Anthony Headley edited this page May 22, 2020
·
4 revisions
Returns the path of the desired directory.
Name | Type | Description | Optional |
---|---|---|---|
Path Type | string | Name of desired directory, e.g. "backups", "shows", "lib_plugins", ... | |
Path | string | either the root of an external or internal drive or an empty string for the root of the console |
Type | Description string | Returns a path to the selected resource.
local backups = GetPathOverrideFor("backups","")
Echo(backups)
-- Windows: C:\ProgramData\MALightingTechnology\gma3_1.1.4\shared\backups
-- Console: /home/ma/MALightingTechnology/gma3_1.1.4/shared/backups
-- grab a list of connected drives
local options = {} -- popup options
local drives = Root().Temp.DriveCollect -- list of attached drives
for i = 1, drives.count , 1 do -- add each drive to the options table
table.insert(options, string.format("%s (%s)", drives[i].name, drives[i].DriveType))
end
local selectedDrive = PopupInput("Select a disk", display_handle, options)
-- if the user cancled then exit the plugin
if selectedDrive == nil then
return
end
-- grab the export path for the selected drive
local exportPath = GetPathOverrideFor("export", drives[selectedDrive + 1].path)
Echo(exportPath)