The following methods display the standard 3ds Max file open, file save, or folder selection browser dialog:
getOpenFileName [ caption:<title> ] \ [ filename:<seed_filename_string> ] \ [ types:<description1>|<pattern1>|<description2>|<pattern2>|...| ] \ [ historyCategory:<string> ]
getSaveFileName [ caption:<title> ] \ [ filename:<seed_filename_string> ] \ [ types:<description1>|<pattern1>|<description2>|<pattern2>|...| ] \ [ historyCategory:<string> ]
Both functions return a fully-specified file path name or undefined if the user cancels out.
When the optional keyword filename: is supplied, the string is used to define the path and file name of the file to be loaded or saved. The dialog automatically navigates to the specified path (if available on the disk/network), displays its content in the browsing area and suggests the file name in the "File name" field. If the path does not exist, the current path is used and only the file name is displayed as requested.
The types: parameter lets you specify custom file types and suffixes for the file type drop-down list in the open and save dialogs. You supply a string for this argument that is formatted in a special way, as follows:
In other words, a sequence of file type descriptions and file type patterns each separated by a '|' vertical bar and terminated by a '|' vertical bar.
The getSaveFileName() function tests for the pre-existence of the file with the chosen file type suffix added.
The history dropdown list in the file load and save dialogs keeps track of previously selected files according to a specified history name. It is available since 3ds Max 2008.
If historyCategory: is not specified, the caption text is used if specified, and if no caption is specified, the default category "MAXScriptFileOpenSave" is used instead.
By using the same historyCategory: name for a pair of open and save dialogs, users will see a consistent history dropdown in the dialogs.
This function displays a folder selection browser for the user to select a folder. Returns a string path name for the selected folder or the value undefined if the user presses Cancel in the folder browser.
If the initialDir: keyword argument is specified, the Browse For Folder dialog will be opened at the specified directory. Symbolic pathnames are acceptable as the pathname. Available in 3ds Max 8 and higher.