\HeaderA{tk\_choose.files}{Choose a List of Files Interactively}{tk.Rul.choose.files}
\keyword{file}{tk\_choose.files}
\begin{Description}\relax
Use a Tk file dialog to choose a list of zero or more files 
interactively.
\end{Description}
\begin{Usage}
\begin{verbatim}
tk_choose.files(default = "", caption = "Select files",
                multi = TRUE, filters = NULL, index = 1)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{default}] which filename to show initially.
\item[\code{caption}] the caption on the file selection dialog.
\item[\code{multi}] whether to allow multiple files to be selected.
\item[\code{filters}] two-column character matrix of filename filters.
\item[\code{index}] unused.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
Unlike \code{\LinkA{file.choose}{file.choose}}, \code{tk\_choose.files} will always
attempt to return a character vector giving a list of files.  If the
user cancels the dialog, then zero files are returned, whereas
\code{\LinkA{file.choose}{file.choose}} would signal an error.

The format of \code{filters} can be seen from the example.  File
patterns are specified via extensions, with \code{"*"} meaning any
file, and \code{""} any file without an extension (a filename not
containing a period).  (Other forms may work on specific platforms.)
Note that the way to have multiple extensions for one file type is to
have multiple rows with the same name in the first column, and that
whether the extensions are named in file chooser widget is
platform-specific. \bold{The format may change before release.}
\end{Details}
\begin{Value}
A character vector giving zero or more file paths.
\end{Value}
\begin{SeeAlso}\relax
\code{\LinkA{file.choose}{file.choose}}, \code{\LinkA{tk\_choose.dir}{tk.Rul.choose.dir}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
Filters <- matrix(c("R code", ".R", "R code", ".s",
                    "Text", ".txt", "All files", "*"),
                  4, 2, byrow = TRUE)
Filters
if(interactive()) tk_choose.files(filter = Filters)
\end{ExampleCode}
\end{Examples}

