Input Box Action Icon

Input Box Action

Declaration

<AMINPUTBOX MESSAGETEXT="text" RESULTVARIABLE="text" WINDOWTITLE="text" POSITION="text [options]" XPOS="number" YPOS="number" DEFAULTBUTTON="number" ICON="text [option]" WINDOWINFRONT="yes/no" COUNTDOWNDELAY="number">

See Also

Input Box Action-Setting Properties, Choice Action, Common Dialog Action, Message Box Action

Description

Displays an input box allowing the user to enter a value. The value entered is saved to the variable specified. Task execution is paused while the task waits for a value to be entered. Useful for asking a question that requires a text response at runtime.

Practical Usage

Similar to the Message Box <AMMESSAGEBOX> action except allows the user to enter a text value in response to a question. The text value is populated into a variable.

Parameters

General Tab

Message to display

Text, required
MARKUP: MESSAGETEXT="The contents of the variable is %VARNAME%"

Specifies the text to be displayed in the input box. Usually this is the question that the user should input the answer to.

 

Default value

Text, optional
MARKUP: DEFAULTVALUE="Question"

Specifies the default text that should appear in the input box when it appears. This parameter is optional.  

 

Populate variable with value entered

text, Optional - Default (none)
MARKUP: RESULTVARIABLE="varname"

Specifies the name of an already created variable that should be populated with the text that the user has input as a response to the question.

 

Title of input box

Text, optional Default (blank)
MARKUP: WINDOWTITLE="QUESTION"

Specifies the title of the message box dialog.

 

Bring message to front of all other windows

Yes/No, Optional - Default - YES
MARKUP: WINDOWINFRONT="NO"

 

If set to YES, specifies that the input box will appear in front of all other open windows.

 

Advanced Tab

Position

Text [options], Optional - Default "center"
MARKUP: POSITION="upper_left"

Specifies the button or array of buttons that should be displayed on the message box.

The available options are:

 

X Pos

Number, Optional - Default 0
MARKUP: XPOS="55"

Specifies the X (horizontal) coordinates of the position that the message box dialog should be displayed on the screen. Move the mouse cursor to the desired location on the screen and press the keyboard's INSERT key to capture the position. This option is only valid if POSITION="custom", otherwise it is ignored.

 

Y Pos

Number, Optional - Default 0
MARKUP: YPOS="55"

Specifies the Y (vertical) coordinates of the position that the message box dialog should be displayed on the screen. Move the mouse cursor to the desired location on the screen and press the INSERT key to capture the position. This option is only valid if POSITION="custom", otherwise it is ignored.

 

Display the Icon in the message box

text [options], Optional - Default "none"
MARKUP: ICON="exclamation"

If enabled, specifies the icon that should be displayed on the input box next to the icon. The icon helps to determine what type of message is being displayed.

The available options are:

 

Button selected by default

Number, Optional - Default 0
MARKUP: DEFAULTBUTTON="2"

Specifies the button that should be selected as the default button. This parameter can be used in conjunction with the Automatically press the default button after parameter.

The available options are:

 

Automatically press the default button after

number, Optional - Default 0
MARKUP: COUNTDOWNDELAY="0"

If enabled, specifies the amount of time that should elapse before the input box clears itself. If the value is 0, the input box is displayed indefinitely.

The available time values are:

 

On Cancel

Text, required
MARKUP: ONCANCEL="fail"

Specifies how the action will react if the user presses the Cancel button or if the Cancel button is automatically pressed after the amount of time specified in the Automatically press the default button after parameter.

The available options are:

 

Mask input

Yes/No, Optional - Default - NO
MARKUP: MASKINPUT="YES"

 

If set to YES, specifies that the information entered in the input box will be masked by the number sign (i.e. ######).

 

Notes

Custom Description

This action includes the Description tab for entering a custom step description.

More on setting custom step description

Standard Error Handling Options

This action also includes the standard Error Causes and On Error failure handling options/tabs.

More on Error Handling Options

Variables and Expressions

All text fields allow the use of expressions, which can be entered by surrounding the expression in percentage signs (example: %MYVARIABLE%, %Left('Text',2)%). To help construct these expressions, you can open Expression Builder from these fields by pressing F2.

More on variables
More on expressions

More on the expression builder

 

Example

NOTE: The code below can be copied and pasted directly into the Steps pane of the Task Builder.

This sample task will demonstrate use of the Input Box action (step 2) by saving the name entered in the input box that appears and then displaying the name in a separate message box.

<AMVARIABLE NAME="theVar"></AMVARIABLE>

<AMINPUTBOX WINDOWTITLE="QUESTION" ICON="exclamation" RESULTVARIABLE="theVar" COUNTDOWNDELAY="10" MASKINPUT="YES">What is your name?</AMINPUTBOX>

<AMMESSAGEBOX>The name entered is %theVar%</AMMESSAGEBOX>