Skip to content
File dialogsReference

openfiledialog

Ask the user to select one existing file.

Details#

Ask the user to select one existing file. The selected full path; nil on cancellation or dialog failure.

Signature#

Luau
openfiledialog(filter: string?, title: string?): string?

Parameters#

ParameterTypeDescription
filteroptionalstringNUL-separated Windows label/pattern pairs; default All Files / *.*. Example: Text files\0*.txt\0. The implementation adds the final double NUL.
titleoptionalstringDialog title; default Open File.

Returns#

The selected full path; nil on cancellation or dialog failure.

Examples#

Local example

Luau
local path = openfiledialog("Text files\0*.txt\0", "Local note")
if path then print(path) end