selectFile {PBSmodelling}R Documentation

Display Dialogue: Open or Save File

Description

Display the default Open or Save prompt provided by the Operating System.

Usage

selectFile(initialfile="",initialdir=getwd(),filetype=list(c("*","All Files")),mode="open",multiple=FALSE,title="",defaultextension="",usewidget=NULL)

Arguments

initialfile initially selected file
initialdir initially directory the dialog opens
filetype a list of character vectors indicating file types made available to users of the GUI. Each vector is of length one or two. The first element specifies either the file extension or "*" for all file types. The second element gives an optional descriptor name for the file type. The supplied filetype list appears as a set of choices in the pull-down box labelled “Files of type:”.
mode string: if "save" display Save As prompt, if "open" display Open prompt.
multiple if TRUE the open prompt can select multiple files. This has no effect for the save prompt.
title title for the prompt window
defaultextension default file extension if none is provided by the user
usewidget store the selected file in the named entry widget

Value

The file name and path of the file(s) selected by the user.

Author(s)

Alex Couture-Beil

See Also

selectDir

Examples

## Not run: 
# Open a filename, and return it line by line in a vector
scan(promptOpenFile(),what=character(),sep="\n")

# Illustrates how to set filetype.
promptOpenFile("intial_file.txt", filetype=list(c(".txt", "text files"), 
               c(".r", "R files"), c("*", "All Files")))
## End(Not run)

#integration with widget via doAction
createWin( c( "entry foo mode=character", 
  "button text=\"select file\" func=doAction action=\"selectFile(usewidget=`foo`)\"" ), astext=TRUE )

[Package PBSmodelling version 2.55.175 Index]