Arbortext Command Language > Functions by Alphabetical Listing > file_selector
  
file_selector
file_selector (dir[, ext[, filter[, title[, flags]]]])
This function displays a file selection dialog box and returns the user's response. The null string is returned if the user selects Cancel.
dir is the directory initially displayed in the dialog box. If the dir directory is not a valid drive, then the dialog box uses the last drive the Open dialog box used to open a file in Arbortext Editor.
The remaining arguments are optional:
filter is a string specifying a list of file types to display in the List Files of Type pulldown list. A vertical bar “|” is used to separate each list item. There are two parts to each item, which are also separated by a vertical bar “|”. The first part is the string displayed in the pulldown list. The second part is the corresponding pattern used to filter the files displayed in the dialog box. See the example that follows.
ext specifies the default extension to display in the File Name control. It should be one of the extensions given in the filter list filter. The extension separator "." must not be included.
title specifies the window title for the dialog box.
flags is a bitmask specifying special file selector settings and is constructed by ORing the flags from the following list:
0x01 — Set this flag to select directories instead of files.
0x02 — Set this flag to allow new files (or directories if bit 0x01 is set) to be created.
0x04 — Set this flag to change the default button in the dialog box from Open to Save.
0x08 — Set this flag if the dir parameter is a file path that should be highlighted as the chosen file when the selector is displayed.
If no value is given, the file selector will be set to open existing files.
Example
l="SGML Files|*.sgm|Command Files|*.acl|All Files|*.*"
fname = file_selector(".", "sgm", l, "Open Document")
The * wildcard will include all files.