Storages.selectFile

Function/Meaning
Displays a file selection dialog box
Type
Method of the Storages class
Syntax
selectFile(params)
Arguments
params Specifies a dictionary array used for passing data.
When passing to this method, the following members can be specified. Also, some members will have their values changed when this method finishes.

filter
Passes filter strings as an array.
A filter string consists of a filter description and the filter itself separated by a | (vertical bar), where the filter uses wildcards. If multiple extensions correspond to one filter, separate them with a ; (semicolon).
To specify multiple filters, use an array.
If omitted, no filter is used.

Example :
["Image files(*.bmp;*.png;*.jpg;*.jpeg;*.eri;*.tlg)|*.bmp;*.png;*.jpg;*.jpeg;*.eri;*.tlg",
"Script files(*.tjs;*.ks)|*.tjs;*.ks"]

filterIndex
Specifies the number of the selected filter (as specified in 'filter').
Specifying 1 selects the first filter specified in 'filter' by default. Specifying 2 selects the second filter (note that this is not a 0-based index; the first item is 1).
If omitted, the first filter is selected.
Also, if the user clicks the OK button, the index of the filter last selected in the dialog box will be set in this member.

name
Specifies the filename. If omitted or an empty string is specified, no file will be selected initially.
Also, if the user clicks the OK button, the selected file will be set in this member.

initialDir
Specifies the folder to display initially.
If omitted, the current directory is used.

title
Displays the title of the dialog box.
If omitted, it defaults to "Open" or "Save As" (depending on the 'save' member setting).

save
Specifies the type of dialog box.
If false (default), the "Open" dialog box is used.
If true, the "Save As" dialog box is used.

defaultExt
Specifies the default extension. This extension is automatically appended if the user does not specify one. Do not include a . (period) in the extension specified here.
If omitted, no extension will be appended.
Return Value
Returns true if the user selects a file and clicks the OK button, and false if they click the Cancel button.
Description
Opens a file selection dialog box.
Example:
var params = %[
filter : [ "Text files(*.txt)|*.txt", "Binary files(*.bin)|*.bin" ],
filterIndex : 1,
name : "",
initialDir : System.exePath,
title : "Open File",
save : false,
];
if(Storages.selectFile(params))
System.inform("Selected file is : " + params.name);