This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.1)

FileNameSetter

FileNameSetter[name]
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.
FileNameSetter[Dynamic[name]]
uses the dynamically updated current value of name, with the value of name being reset if a different file is chosen.
FileNameSetter
brings up a file saving dialog.
FileNameSetter
looks for files of types with names matching the file patterns .
"Open"file opening dialog (default)
"OpenList"multiple file opening dialog
"Save"file saving dialog
"Directory"directory picking dialog
  • In FileNameSetter, name is normally a single complete file name string.
  • If the file browser dialog is closed without choosing a file name, FileNameSetter leaves name unchanged.
  • If no file type specification is given, the file browser dialog will list files of all types.
  • The 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, the string will be used in place of .
  • Other expressions given as settings for Appearance are used literally as the appearance of the unclicked FileNameSetter.
  • File names in FileNameSetter use the pathname separator appropriate for your computer system.
  • The settings for BaseStyle are appended to the default style typically given by the style in the current stylesheet.
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:
Assign the full path of a file to a variable:
In[1]:=
Click for copyable input
Out[1]=
 
Assign the full path of multiple files to a variable:
In[1]:=
Click for copyable input
Out[1]=
 
Assign the full path of a new file without actually creating it:
In[1]:=
Click for copyable input
Out[1]=
 
Assign the full path of a directory to a variable:
In[1]:=
Click for copyable input
Out[1]=
New in 6