ui.showOpenFileDialog
Shows an open file dialog.
caption string (window title)
initialFilename string (initial filename or folder to display)
filter string (file extensions to include see example 1)
defaultExt string (default extension to append if none is provided by the user)
selectedFilename string (or empty string if cancelled)
local filename = ui.showOpenFileDialog("Select Text File", "", "Text Files|*.txt|All Files|*.*", "txt")
if filename ~= "" then
print("Selected file " .. filename)
else
print("No file was picked")
end
local filename = ui.showOpenFileDialog("Select Any File", "C:\\Some Folder\\", "", "")
local filename = ui.showOpenFileDialog("Select Any File", "C:\\Some Folder\\Some File.txt", "", "")
The initialFilename parameter defaults to My Documents folder if empty string is provided.
Generated on the 26 June 2024 at 22:01:29 (UK Time)