represents a file name setter which displays as a Browse button and when clicked brings up a system file opening dialog, starting from the location corresponding to name.


uses the dynamically updated current value of name, with the value of name being reset if a different file is chosen.


brings up a file saving dialog.


looks for files of types typei with names matching the file patterns pattij.

Details and Options

  • In FileNameSetter[name,"spec"] possible specifications of dialogs to use are:
  • "Open"file opening dialog (default)
    "OpenList"multiple file opening dialog
    "Save"file saving dialog
    "Directory"directory picking dialog
  • In FileNameSetter[name,"spec"], name is normally a single complete file name string.
  • In FileNameSetter[name,"OpenList"], name is always a list of file name strings.
  • FileNameSetter[name,"Save"] generates a warning if the file picked already exists.
  • If the file browser dialog is closed without choosing a file name, FileNameSetter leaves name unchanged.
  • FileNameSetter["",] uses no initial file name.
  • If no name is given that determines a valid directory, FileNameSetter uses as a default $UserDocumentsDirectory.
  • If no file type specification is given, the file browser dialog will list files of all types.
  • The typei give the names of filters to be listed in the file browser, and to be used for picking out files whose names match the file patterns specified.
  • The following options can be given:
  • AppearanceAutomaticthe appearance of the file name setter
    BaseStyle{}base style specifications for the setter
    EnabledAutomaticwhether the setter is enabled, or grayed out
    ImageMargins0margins around the displayed setter
    ImageSizeAutomaticoverall size of the displayed setter
    WindowTitleAutomaticthe title of the browser window
  • With the setting Appearance->"form", the string "form" will be used in place of "Browse".
  • Other expressions given as settings for Appearance are used literally as the appearance of the unclicked FileNameSetter.
  • FileNameSetter is intended primarily for use with local kernels.
  • File names in FileNameSetter use the pathname separator appropriate for your computer system.
  • FileNameSetter[] is equivalent to FileNameSetter["","Open"].
  • Setting can be used to find the file name specified by FileNameSetter.
  • The settings for BaseStyle are appended to the default style typically given by the "FileNameSetter" style in the current stylesheet.


open allclose all

Basic Examples  (4)

Assign the full path of a file to a variable:

Assign the full path of multiple files to a variable:

Assign the full path of a new file without actually creating it:

Assign the full path of a directory to a variable:

Scope  (1)

Specify the file types and patterns:

Wolfram Research (2007), FileNameSetter, Wolfram Language function,


Wolfram Research (2007), FileNameSetter, Wolfram Language function,


Wolfram Language. 2007. "FileNameSetter." Wolfram Language & System Documentation Center. Wolfram Research.


Wolfram Language. (2007). FileNameSetter. Wolfram Language & System Documentation Center. Retrieved from


@misc{reference.wolfram_2024_filenamesetter, author="Wolfram Research", title="{FileNameSetter}", year="2007", howpublished="\url{}", note=[Accessed: 21-July-2024 ]}


@online{reference.wolfram_2024_filenamesetter, organization={Wolfram Research}, title={FileNameSetter}, year={2007}, url={}, note=[Accessed: 21-July-2024 ]}