> For the complete documentation index, see [llms.txt](https://documentation.hak5.org/wifi-pineapple-pager/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://documentation.hak5.org/wifi-pineapple-pager/text_picker.md).

# TEXT\_PICKER

`TEXT_PICKER` Prompt the user to interactively enter text via the UI.

### When to use it <a href="#when-to-use-it" id="when-to-use-it"></a>

Use `TEXT_PICKER` any time text is required, such as a host name or username.

#### Syntax <a href="#syntax" id="syntax"></a>

```none
TEXT_PICKER [text prompt] [default text]
```

**text prompt&#x20;*****required***

Text prompt / dialog title shown to the user. Text prompts should be kept short enough to fit on the device display.

**default text&#x20;*****required***

Default text when the picker launches. Must be an empty string (`""`) for a blank prompt.

{% hint style="warning" %}
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.
{% endhint %}

<figure><img src="/files/JPeB8GWt8A1kzcn3ZCqA" alt="The text picker dialog"><figcaption><p>The text picker dialog</p></figcaption></figure>

<figure><img src="/files/UsG2hon3UXMwMUaI87P4" alt="The text picker editor"><figcaption><p>The text picker editor</p></figcaption></figure>

### Results <a href="#results" id="results"></a>

`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 <a href="#examples" id="examples"></a>

```bash
__host=$(TEXT_PICKER "Target hostname" "foo-client") || exit 0
```

```bash
__demo=$(TEXT_PICKER "No default text" "") || exit 0
```

{% hint style="info" %}
Remember to enclose the prompt text in quotes if it contains spaces!
{% endhint %}
