Skip to content
Saiko

openfiledialog

Opens a dialog for the user to pick a file from anywhere on their computer, and returns it. Only the calling thread waits until the dialog is dismissed.

Signature

luau
openfiledialog(options: fileDialogOptions?): file?

Parameters

optionsfileDialogOptions?

Optional: the window title, the folder it opens in and the file types that can be picked.

Returns

file?

Note

Example

luau
print("Pick a config to use")

local config
local configFile = openfiledialog({
    extensionFilter = { "json" },
})

if configFile then
    config = configFile:Read()
else
    print("No config selected.")
end