< Previous | Contents | Next >
Ask User
{Input Name, Input Type, Options ...}
A simple way to build and evaluate a dialog is called: comp:AskUser(name, {table of inputs}). Each input is a table structured as follows :
Input Name (string, required)
This name is the index value for the controls value as set by the user (i.e., dialog.Control or dialog[“Control Name”]). It is also the label shown next to the control in the dialog, unless the Name option is also provided for the control.
Input Type (string, required)
A string value describing the type of control to display. Valid strings are FileBrowse,PathBrowse, Position, Slider, Screw, Checkbox, Dropdown, and Text. Each Input type has its own properties and optional values.
Options (misc)
Different control types accept different options that determine how that control appears and behaves in the dialog.

Note
This function can only be called interactively, command line scripts cannot use this function.
All script execution stops until the user responds to the dialog by selecting OK or Cancel. The returned table contains the responses from the user, or nil if the user canceled the dialog.
![]()
dump(ret)
ret = composition:AskUser(“A Sample Dialog”, { {“Select a Directory”, “PathBrowse”} } )
For example, if you wanted to display a dialog that requested a path from a user, you might use the following script:
Several of the Options are common to several controls. For example, the name option can be used with any type of control, and the DisplayedPrecision option can be used with any control that displays and returns numeric values. The commonly used options for controls are:
> Name (string)
This option can be used to specify a more reasonable name for this inputs index in the returned table than the one used as a label for the control.
> Default (string)
The default value displayed when the control is first shown.
> Min (integer)
Sets the minimum value allowed by the slider or screw control.
> Max (numeric)
Sets the maximum value allowed by the slider or screw control.
> DisplayedPrecision (numeric)
Use this option to set how much precision is used for numeric controls like sliders, screws and position controls. A value of 2 would allow
two decimal places of precision - i.e., 2.10 instead of 2.105
> Integer (boolean)
If true the slider or screw control will only allow integer (non decimal) values, otherwise the slider will provide full precision. Defaults to false if not specified.
![]()