Skip to content
File dialogsReference

savefiledialog

Ask the user to choose a destination filename.

Details#

Ask the user to choose a destination filename. The selected full path; nil on cancellation or dialog failure.

Signature#

Luau
savefiledialog(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 Save File.

Returns#

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

Examples#

Local example

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