Go to: Synopsis. Return value. Related. Flags. MEL examples.

Synopsis

fileBrowserDialog [-actionName string] [-dialogStyle int] [-fileCommand script] [-fileType string] [-filterList string] [-includeName string] [-mode int] [-operationMode string] [-tipMessage string] [-windowTitle string]

fileBrowserDialog is undoable, NOT queryable, and NOT editable.

The fileBrowserDialog command offers more control of the windows file browser dialog. See the fileDialog command for cross platform file dialog support.

Return value

string

Related

finder

Flags

actionName, dialogStyle, fileCommand, fileType, filterList, includeName, mode, operationMode, tipMessage, windowTitle
Long name (short name) Argument types Properties
-mode(-m) int create
Defines the mode in which to run the file brower:
  • 0 for read
  • 1 for write
  • 2 for write without paths (segmented files)
  • 4 for directories have meaning when used with the action
+100 for returning short names
-fileCommand(-fc) script create
The script to run on command action
-fileType(-ft) string create
Set the type of file to filter. By default this can be any one of: "mayaAscii", "mayaBinary", "mel", "OBJ", "directory", "plug-in", "audio", "move", "EPS", "Illustrator", "image".
plug-ins may define their own types as well.
-actionName(-an) string create
Script to be called when the file is validated.
-operationMode(-om) string create
Enables the option dialog. Valid strings are:
  • "Import"
  • "Reference"
  • "SaveAs"
  • "ExportAll"
  • "ExportActive"
-includeName(-in) string create
Include the given string after the actionName in parentheses. If the name is too long, it will be shortened to fit on the dialog (for example, /usr/alias/commands/scripts/fileBrowser.mel might be shortened to /usr/...pts/fileBrowser.mel)
-dialogStyle(-ds) int create
  • 0 for old style dialog
  • 1 for Windows 2000 style Explorer style
  • 2 for Explorer style with "Shortcut" tip at bottom
-filterList(-fl) string createmultiuse
Specify file filters. Used with dialog style 1 and 2. Each string should be a description followed by a comma followed by a semi-colon separated list of file extensions with wildcard.
-tipMessage(-tm) string create
Message to be displayed at the bottom of the style 2 dialog box.
-windowTitle(-wt) string create
Set the window title of a style 1 or 2 dialog box

Flag can appear in Create mode of command Flag can appear in Edit mode of command
Flag can appear in Query mode of command Flag can be used more than once in a command.

MEL examples

global proc int importImage( string $filename, string $fileType )
{
    file -import $filename;
    return 1;
}


fileBrowserDialog -m 0 -fc "importImage" -ft "image" -an "Import_Image" -om "Import";