Dialog - File Browse

Displays either a "File Open" or a "Save As" dialog that allows the user to browse for a file. The full path to the selected file will then be stored in the variable of your choice. If the user cancels out of the dialog, "CANCEL" will be stored in the variable instead.

Action ID:
Action Category:
Action List Syntax:

54
Dialog
<<VARIABLE>>
= Dialog.FileBrowse (<<DIALOGTYPE>>, <<DIALOGTITLE>>, <<DEFAULTDIR>>, <<FILEFILTERS>>)

Settings

Locations

Default folder:

The initial folder that will be displayed in the Browse For File dialog. If this folder does not exist, the dialog will open to the current working directory instead. Note that when the user selects a file, the current working directory is automatically set to the folder where the file they selected was located.

Leave this field blank if you want the user to be able to continue browsing from the same place next time. (If you leave this field blank, subsequent "Dialog - File Browse" actions will start at the same path that the user last selected.)

Enter a valid path in this field if you want the user to always start browsing from that path, no matter where they ended up browsing to before.

File filters:

The file filters that the Browse For File dialog will use. These filters control which file types will be visible in the Browse For File dialog.

The file filters must use the following syntax:

LongDescription|Pattern|

Example:

Executables (*.exe)|*.exe|Batch Files (*.bat)|*.bat|

"Executables (*.exe)" is the Long description of the first file filter, and "Batch Files (*.bat)" is the long description of the second file filter.

"*.exe" is the pattern or "file mask" for the first file filter; only filenames that match this pattern will be visible when this file filter is selected. (In most cases the filename will simply be the file extension.) "*.bat" is the pattern for the second file filter.

You can specify more than one pattern for a filter, too, by separating the patterns with semicolons:

Pictures (.png, .jpg, .tif)|*.png;*.jpg;*.tif

And you can put anything you want in the long description, too:

Video Files (Hi Mom!)|*.avi;*.mpg;*.mpeg;*.asf;*.asx*;*.wmv;*.wvx*

Of course, your users will probably appreciate a short list of extensions more. :)

Video Files (.avi, .mpg, .asf, .wmv)|*.avi;*.mpg;*.mpeg;*.asf;*.asx*;*.wmv;*.wvx*

Default filename:

The default filename that will be displayed in the File name field on the Browse For File dialog.

Default file extension:

The default file extension that will be added to the file name if no file filters are used.

Options

Allow Multiple File Selection

Controls whether the user can select more then one file by using the Shift or Ctrl key.

File Must Exist

Toggles whether or not the file the user selects must already exists.  This option is only available for the "File Open" dialog.

Dialog

Dialog title:

The title for the Browse For File dialog window.

Variable

Store result in variable:

The variable that the full path to the selected file will be stored in.

If the user selects more than one file, a semicolon delimited list of full paths will be stored in this variable. If the user cancels out of the dialog, the word "CANCEL" will be stored in this variable instead.

Dialog Type

Controls which type of Browse For File dialog will be used. Both dialog types are nearly identical, however the "File must exist" option is only available for the "File Open" dialog type.

File open

A Browse For File dialog for opening files. This dialog type will use the text "Open" on the 'select' button.

Save as...

A Browse For File dialog for saving files. This dialog type will use the text "Save" on the 'select' button

Error Codes

Value
(%LastErrorNum%)

Simple Message
(%LastErrorMsg%)

Verbose Message
(%LastErrorDetails%)

0 (OK)

 

 

Examples

Browsing for and playing an MP3