AutoHotkeyInput Field


Introduction

To get a user's input and store it in a variable, you can use the InputBox command. The script will not continue executing commands until the user either presses 'OK' or 'Cancel'.

'OK' will close the window and save the user's input 'Cancel' will close the window, discarding the user's input

Parameters

InputBox, OutputVar [, Title, Prompt, HIDE, Width, Height, X, Y, Timeout, Default]What each Option Means
OutputVarThe variable the user's input will be saved to
TitleThe name of the input box
PromptText inside of the input box
HIDEDisplays the user's input as asterisks to hide the input - type HIDE to enable
WidthThe width of the input box
HeightThe height of the input box
XThe amount of pixels from the left edge of the screen that the top-left corner of the input box will be
YThe amount of pixels from the top edge of the screen that the top-left corner of the input box will be
TimeoutAutomatically closes the input box and saves the user's input after this time in miliseconds
DefaultThe text that will appear in the input box's editable field when it is opened

Remarks

An input box is a GUI item, so it will be treated as a GUI item.

A list of errorlevels for this command:

ErrorlevelWhat it Means
0The user pressed the 'OK' button
1The user pressed the 'Cancel' button
2The input box timed out

You can find the page for this command on the AutoHotkey documentation here: https://autohotkey.com/docs/commands/InputBox.htm