On this page
article
TEXT_PICKER
TEXT_PICKER Prompt the user to interactively enter text via the UI.
When to use it
Use TEXT_PICKER any time text is required, such as a host name or
username.
Syntax
TEXT_PICKER [text prompt] [default text]
text prompt required
Text prompt / dialog title shown to the user. Text prompts should be kept short enough to fit on the device display.
default text required
Default text when the picker launches. Must be an empty string
("") for a blank prompt.
Default text should typically be provided. The prompt the user to enter
with no default, use a blank quoted string (
"") for the default text
parameter.
Results
TEXT_PICKER will wait until the user has made a selection, pausing the payload.
TEXT_PICKER exits with a return code of 0 if the user continues, and non-zero if the user cancels.
TEXT_PICKER returns the text as the output.
Examples
__host=$(TEXT_PICKER "Target hostname" "foo-client") || exit 0
__demo=$(TEXT_PICKER "No default text" "") || exit 0
Remember to enclose the prompt text in quotes if it contains spaces!