({{, (RefLink[FileNameSetter, paclet:ref/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. }, {, (RefLink[FileNameSetter, paclet:ref/FileNameSetter])[(RefLink[Dynamic, paclet:ref/Dynamic])[name]] 
uses the dynamically updated current value of name, with the value of name being reset if a different file is chosen.}, {, (RefLink[FileNameSetter, paclet:ref/FileNameSetter])[name,"Save"] 
brings up a file saving dialog.}, {, (RefLink[FileNameSetter, paclet:ref/FileNameSetter])[name,"spec",{"(Subscript[type, 1])"->{"(Subscript[patt, 11])","(Subscript[patt, 12])",…},"(Subscript[type, 2])"->{…},…}]
looks for files of types (Subscript[type, i]) with names matching the file patterns (Subscript[patt, ij]). }})

OpenersNotesSection(Spacer1)Details and Options

In (RefLink[FileNameSetter, paclet:ref/FileNameSetter])[name,"spec"] possible specifications of dialogs to use are:

In (RefLink[FileNameSetter, paclet:ref/FileNameSetter])[name,"spec"], name is normally a single complete file name string.

In (RefLink[FileNameSetter, paclet:ref/FileNameSetter])[name,"OpenList"], name is always a list of file name strings.

(RefLink[FileNameSetter, paclet:ref/FileNameSetter])[name,"Save"] generates a warning if the file picked already exists.

If the file browser dialog is closed without choosing a file name, (RefLink[FileNameSetter, paclet:ref/FileNameSetter]) leaves name unchanged.

(RefLink[FileNameSetter, paclet:ref/FileNameSetter])["",…] uses no initial file name.

If no name is given that determines a valid directory, (RefLink[FileNameSetter, paclet:ref/FileNameSetter]) uses as a default (RefLink[$UserDocumentsDirectory, paclet:ref/$UserDocumentsDirectory]).

If no file type specification is given, the file browser dialog will list files of all types.

The (Subscript[type, i]) 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:

With the setting (RefLink[Appearance, paclet:ref/Appearance])->"form", the string "form" will be used in place of "Browse…".

Other expressions given as settings for (RefLink[Appearance, paclet:ref/Appearance]) are used literally as the appearance of the unclicked (RefLink[FileNameSetter, paclet:ref/FileNameSetter]).

(RefLink[FileNameSetter, paclet:ref/FileNameSetter]) is intended primarily for use with local kernels.

File names in (RefLink[FileNameSetter, paclet:ref/FileNameSetter]) use the pathname separator appropriate for your computer system.

(RefLink[FileNameSetter, paclet:ref/FileNameSetter])[] is equivalent to (RefLink[FileNameSetter, paclet:ref/FileNameSetter])["","Open"].

(RefLink[Setting, paclet:ref/Setting]) can be used to find the file name specified by (RefLink[FileNameSetter, paclet:ref/FileNameSetter]).

The settings for (RefLink[BaseStyle, paclet:ref/BaseStyle]) are appended to the default style typically given by the "FileNameSetter" style in the current stylesheet.

OpenersPrimaryExamplesSection(Spacer1)Examples  (5)

OpenersExampleSection0(Spacer1)Basic Examples  (4)

Assign the full path of a file to a variable:

{FileNameSetter[Dynamic[f]],Dynamic[f]}

Assign the full path of multiple files to a variable:

{FileNameSetter[Dynamic[f],"OpenList"],Dynamic[f]}

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

{FileNameSetter[Dynamic[f],"Save"],Dynamic[f]}

Assign the full path of a directory to a variable:

{FileNameSetter[Dynamic[f],"Directory"],Dynamic[f]}

OpenersExampleSection1(Spacer1)Scope  (1)

Specify the file types and patterns:

{FileNameSetter[Dynamic[f],"Open",{"Mathematica files"->{"*.nb","*.m"},"All files"->{"*"}}],Dynamic[f]}

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[SystemDialogInput, paclet:ref/SystemDialogInput])  ▪  (RefLink[FindFile, paclet:ref/FindFile])  ▪  (RefLink[FileNames, paclet:ref/FileNames])  ▪  (RefLink[Get, paclet:ref/Get])  ▪  (RefLink[InputField, paclet:ref/InputField])  ▪  (RefLink[$HomeDirectory, paclet:ref/$HomeDirectory])  ▪  (RefLink[$UserDocumentsDirectory, paclet:ref/$UserDocumentsDirectory])  ▪  (RefLink[Button, paclet:ref/Button])  ▪  (RefLink[ActionMenu, paclet:ref/ActionMenu])  ▪  (RefLink[Hyperlink, paclet:ref/Hyperlink])}})}})

({{DocumentationFooterIconsRelatedTutorial.png, ({{Tutorials}, {▪(RefLinkPlain[Generalized Input, paclet:tutorial/GeneralizedInput])}, {▪(RefLinkPlain[Creating Dialog Boxes, paclet:tutorial/CreatingDialogBoxes])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Control Objects, paclet:guide/ControlObjects])}, {▪(RefLinkPlain[File Operations, paclet:guide/FileOperations])}, {▪(RefLinkPlain[Operations on File Names, paclet:guide/OperationsOnFileNames])}, {▪(RefLinkPlain[Palettes, paclet:guide/Palettes])}, {▪(RefLinkPlain[Generalized Input, paclet:guide/GeneralizedInput])}, {▪(RefLinkPlain[Creating Inspectors, paclet:guide/CreatingInspectors])}})}})