For modal windows such as Open(), further script execution waits until the modal window is dismissed. Whenever JMP encounters a script to launch a platform that lacks column assignments and that requires column assignments, the platform’s launch window appears, to get column assignments, but continues with the script immediately. That is, JMP does not wait for answers, as in the case of Open(), and other modal dialog boxes. See the chapter Scripting Platforms, for more about launching platforms.
You can prompt the user to select a directory using the Pick Directory command. The command displays a platform-specific window in which the user selects a folder. On Windows, the optional prompt string appears at the top of the Browse for Folder window.
The "prompt message" is used as the window title. The "initial directory" defines which folder initially appears. If a directory is defined as an empty string, the default directory is used.
You can also define the {filter list} used for the Open() window, forcing it to show only certain file types. This list must use the following syntax:
Each quoted string adds an entry to the File name list in the Open() window. Label defines the text that is displayed for each menu option. The following list of suffixes defines the file types that are displayed if its corresponding label is selected. Note the use of "*" to list all files in the window.
The <first filter> argument sets the default selection where n is the index for the list item. In the script above, the <first filter> is the first item in the list.
If the <Save Flag> is false, the window is an File Open window; if <Save Flag> is true, the window is a Save File window. If <Save Flag> is false, the "Multiple" argument to allow opening multiple files using the one window:
names = Files In Directory(path, <recursive>);
Notice that the files within the Design Experiment subdirectory are not included. And only files in the root $SAMPLE_DATA directory are listed.
To return a list of all file names, add the optional recursive argument to Files In Directory:
The Files in Directory command accepts native and POSIX paths, as well as paths using path variables. See Path Variables in Types of Data for details on working with paths.