PromptForFile
Previous Topic  Next Topic 

::InstallAPI::PromptForDirectory


Pop up a window prompting the user to choose a file (or multiple files) on the target system.



Supported Platforms

All



Returns

A full directory path if the user selects a file, a list of files if the user is allowed to select multiple files or an empty string if they cancel.



Options


-defaultextension <file extension>

The default file extension to open the dialog with as well as the default extension to append if the user types in the name of a file without an extension.


-filetypes <file type list>

This is a Tcl list of lists that specifies valid file types for the dialog.  The file types are specified as a list of lists where each inner list contains two elements: a text description and a file extension.  Example:


{{Text Files}  {.txt}}

{{All Files}  {*}}


-initialdir <directory>

The initial directory to start the dialog in.


-initialfile <filename>

The initial file (or files in multiple mode) to select in the dialog when it first pops up.


-message <message string>

A message to display at the top of the dialog window.


-multiple <boolean>

Whether or not the user should be allowed to select multiple files.


-normalize <boolean>

How to normalize the directory the user chooses.  The options are: backslash, forwardslash, platform, unix or windows.  Backslash will replace all directory separators with backslashes.  Forwardslash will replace all directory separators with forward slashes.  Platform means to do whatever the current platform does.  Unix means to use forward slashes and remove any Windows drive letter (C:, D:, etc...).  Windows means to use back slashes and leave any drive letter in place.  The default is platform.


-title <title string>

A title string to display in the title bar of the dialog.


-type <open or save>

The type of dialog to use, either: open or save.  Open means that the dialog expects the file to already exist on the system to be opened.  Save means that dialog can specify a file that does not already exist, and it will prompt the user if the file does exist.


-variable <variable name>

A variable name to store the resulting directory in.


-virtualtext <virtual text name>

A virtual text name (without the <% and %>) to store the resulting directory in.