File
Displays a file picker row showing a file type icon, name and modification time. Tap to choose a new file. Typically used to select a data file whose path is consumed by a service script.
Key | Type | Description | Required | Default | Min Version |
---|---|---|---|---|---|
initialPath | string | Initial top-level directory | – | XPP root | – |
allowedExtensions | array of string | Allowed file extensions | – | [] | – |
label | string | Title shown when no file is selected | Localizable | "" | 1.2-10 |
footerText | string | Description shown when no file is selected | Localizable | "" | 1.2-10 |
isFile | boolean | Pick file if true; pick directory if false | – | true | 1.2-10 |
Swipe left to reveal a delete button to clear the saved value.
initialPath
is relative to the XPP bundle. If omitted, the current XPP path is used.
allowedExtensions
filters the displayed items; non-matching extensions are hidden and cannot be selected.
Return Type | Description |
---|---|
string | Absolute path of the selected file |
Theme
Theme Key | Type | Description |
---|---|---|
labelColor | Color | Filename color |
valueColor | Color | File description color |
Example
{
cell = "File";
key = "file1";
initialPath = "scripts";
isFile = true; -- Pick a file
label = "Please choose a script"; -- Title
-- footerText = "All script formats supported by XXT are allowed";
allowedExtensions = { "lua"; "xxt"; "xpp" }; -- Allowed extensions
};