Show Message Box
Verb: messageBox
Displays a message box to the user with an error, warning, information or question.
Syntax
messageBox --title(String) --text(String) --icon(Nullable<MessageBoxIconWrapper>) --buttons(Nullable<MessageBoxButtonsWrapper>) --defaultbutton(Nullable<DefaultMessageBoxButton>) (String)=value
Inputs
Script | Designer | Required | AcceptedTypes | Description |
---|---|---|---|---|
--title | Title | Required | Text | Message box title. |
--text | Text | Required | Text | Message box contents. |
--icon | Icon | Required | MessageBoxIconWrapper | Icons that are displayed in the message box, representing a question, error, warning or information. The icon options are the following:
|
--buttons | Buttons | Required | MessageBoxButtonsWrapper | Button sets that appear in the message box. The button options are the following:
|
--defaultbutton | Default button | Required | DefaultMessageBoxButton | This option is used to choose one of the buttons set in Buttons to be preselected by default. The following options are available:
The above options refer to which button should be highlighted (preselected) relative to the selected button set. |
Outputs
Script | Designer | AcceptedTypes | Description |
---|---|---|---|
value | Result | Text | Name of the button that was pressed. |
Example
Displays a message box with an information and two options provided: "Ok" and "Cancel".
defVar --name titleMessage --type String --value "Message Title!!"
defVar --name textMessage --type String --value "Message text!"
defVar --name buttonSelected --type String
messageBox --title "${titleMessage}" --text "${textMessage}" --icon "Information" --buttons "OKCancel" --defaultbutton "SecondButton" buttonSelected=value
//Displays a message box with two options.
logMessage --message "${buttonSelected}" --type "Info"
The result varies according to the button selected by the user.
Remarks
The defined Default button is pre-selected and highlighted, demonstrating that it is the default button in the message box.
When the Show Message Box command is executed by the IBM RPA Launcher, a window is displayed in the foreground.