FileSaveDialog
Displays a file save dialog.
Syntax
-
FileSaveDialog(fn, filters[, defext])
-
fn
is a string -
filters
is a list of strings -
defext
is a string
-
Description
FileSaveDialog
displays a file save dialog in which the user can select a file name.
-
fn
is the default file name. -
filters
is a list of file type filters. Each filter is a string of the formtext|mask
wheretext
is the displayed text of the filter (such as “Text files”), andmask
is the file name mask (such as “*.txt”). -
If specified,
defext
is the default file name extension, including or excluding a leading full stop. If the user doesn’t specify an extension, this one is automatically appended to the result unless the filter dictates a different extension, which is then appended instead. The filter’s first extension is used in that case. Ifdefext
is not specified, no extension is automatically appended.
If the user selects a file name, it is returned by the function as a string. If the user cancels the dialog, an error is raised, which can optionally be handled using the try
or the succeeded
function.