Table of Contents

OpenFialDialog (Function) and SaveFileDialog (Function)

Format

openfiledialog ( prompt, path, filter )
savefiledialog ( prompt, path, filter )

returns file_name or “” if no file was selected.

Description

Displays a system dialog that allows a user to select an existing file (open/save) or a new file name (save). The function has three parameters: 1) a prompt message that will be displayed in the top of the dialog window, 2) the path or filename where the dialog box opens to, and 3) a string containing filters for specific file types.

If the path is the empty string '' then the current folder will be opened. Filters may be specified in the format “name (*.ext *.ext…)” if multiple filters are desired you must use two semicolons to separate them.

- Example

f = openfiledialog("",".","Images (*.png *.xpm *.jpg);;Text files (*.txt);;XML files (*.xml)")
print f

See Also

2016/01/01 22:42

New To Version

2.0.0.6