该帮助的版本不再更新,请参见https://www.jmp.com/support/help/zh-cn/15.2 获取最新的版本.


You can prompt the user to select a directory using the Pick Directory() function. 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 window (Windows) or below “Open” on the Finder window (Macintosh). You can also specify the path for an initial directory that appears, and specify whether files should appear in the Pick Directory window.
<"prompt message">, <"initial directory"> <{filter list}>,
<first filter>, <save flag>, <"default file">,
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.
path = Pick File(
"Select JMP File", // prompt message
"$SAMPLE_DATA", // initial directory
{"JMP Files|jmp;jsl;jrn", "All Files|*"}, // file filter list
1, // intially selected item
0, // doesn’t prompt the user to save the file
"Analgesics.jmp" // file that is selected by default
path = Pick File(
"Select JMP File",
"", // no default directory
{"JMP Files|jmp;jsl;jrn", "All Files|*"},
1,
0,
"" // no default file
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: "JMP Files|jmp;jsl;jrn".
If <Save Flag> is false, the Multiple argument can be added to allow the user to select multiple files using the one window:
path = Pick File(
"Select JMP File",
"",
{"JMP Files|jmp;jsl;jrn", "All Files|*"},
1,
0,
"",
multiple // save flag is 0, allows multiple file selection