Show-PdMessageBox
Show-PdMessageBox
Displays a dialog box with any message and various buttons; the value of the pressed button is stored in a variable if required. In the options you control the activation of the selected buttons and set a time interval when the dialog box is closed if no user action has taken place.
Settings:
- Dialog text
Text that is displayed in the message window. You can format the text with line breaks and define multilingual messages. To specify multilingual text, use either the syntax known from DSM <dDeutscher Text auch mit Zeilenumbruch><eEnglisch text even with line breaks> or the syntax used by the Packaging PowerBench in the configuration files, where you prefix the language in curly brackets to the following text, for example {de} Deutscher Text auch mit Zeilenumbruch {en} English text even with line breaks.
If the region and language settings of a computer are set to one of the supported languages, the corresponding text is displayed when the command is executed. In all other cases, the English text is displayed. - Variable name
Optional - Name of a variable containing the pressed button. Specify only the name of the variable, not the $ sign and the curly braces. Depending on which button was pressed, the variable contains one of the following values: - OK: OK
- Cancel: CANCEL (ABORT when using option "Abort, Ignore, Retry")
- Yes: YES
- No: NO
- Ignore: IGNORE
- Abort: ABORT
- Retry: RETRY
- Buttons for message box
Specifies which buttons are displayed in the message window. The following combinations are available: - OK (default)
- OK, Cancel
- Yes, No
- Yes, No, Cancel
- Abort, Ignore, Retry
- Retry, Cancel
- Icon for message box
Specifies whether and if so, which icon is displayed in the message window. The following options are available: - None (default)
- Error
- Warning
- Note
- Information
- Dialog caption
Text that will be displayed in the title bar of the message window. If you leave the setting blank, the title "Message" will be used. If you want to display a message without a title text, enter a blank here. You can specify a multilingual text, of which the appropriate one will be displayed (see Dialog text setting) - Close dialog automatically after a waiting period
If the option is enabled, the message windows will be closed automatically after the display time entered in the "Seconds" setting. - Seconds
Time span in seconds after which the message is automatically closed. - Action after closing the box automatically
Specifies what value the variable should have after automatic closing, as if the user had pressed the corresponding key. Select the "Timeout" option if the variable should contain the value "TIMEOUT", which you can check for in the further course of the script..
Example:
The following example defines a message in English and German, where the user should decide whether he wants a backup of the existing settings.
Corresponds to DSM eScript commands:
- MsgBox
- MsgBoxEx
See also: