listpick ?options? list
Display a dialog with the list displayed in a table view. If the user presses the Cancel button, an error is returned. If the user selects the OK button, or double clicks an item in the list, that item will be returned. Valid options are:
-attributes numattributes of the list view
-cancel strtext of the Cancel button
-header listheaders at the top of the list view columns
-height numheight of the dialog
-indicesuse indices rather than names
-lsynonym of -multi (deprecated)
-L lista list of default item(s) to be initially selected
-multiallow multiple items to be selected, return a list
-num numnumber of columns in the list view (default is 1)
-ok strtext of the OK button
-prompt strprompt text at the top of the dialog
-truncate strset the truncation mode
-width numwidth of the dialog
--end of options
The -attributes option takes the same values as the -attr option of the Table View view (see the table of possible values). If the -attributes option is not specified, the command sets the following flags by default: AllowsTypeSelect, UsesAlternatingRowBackgroundColors, AllowsColumnResizing, AllowsEmptySelection. If there is only one column, the NoHeader attribute is also set by default.
If the -num option is specified with value n, the list of items is a list of n-element sublists: each sublist corresponds to the n elements displayed in a row.
If accompanied by -multi, all items in the -L list will be selected, otherwise only the first item is selected.
If the -indices option is specified, the command returns a list of the indices of the selected items and, in that case, the -L option expects a list of the indices of the default item(s) to be initially selected.
The -truncate option sets the truncation mode used to display items that are too long to fit in the width of the table. It takes the same values as the -truncate option of the Table View view (see the possible values here).