Onetastic Macro Documentation >
>
>
ShowTaskDialog ShowTaskDialog
Shows a task dialog to the user with a number of command buttons to choose from.
Syntax
Integer ShowTaskDialog(
String title,
String message,
Array<String> buttons)
Parameters
- String title
- A title for the task dialog.
- String message
- A message for the task dialog that will show below the title.
- Array<String> buttons
- An array of button labels.
RemarksA task dialog contains a title, a message and a set of command buttons. It may look like this:
User can click one of the command buttons or close the dialog. If user clicks one of the buttons,
the dialog will close and this function will return the index of the button in the given button array
(0 for the first button, 1 for the second button etc). If user closes the dialog using the X button
on the top right corner, then macro execution will stop.
Examples
$message = "You can save the currently selected text as a snippet to be used for later, or you can insert one of the previously saved snippets to the current page."
$buttons = Array("Insert previously saved text snippet", "Save selected text as a snippet", "Manage text snippets")
$selected = ShowTaskDialog("Choose an option", $message, $buttons)
switch ($selected)
case 0:
break 1
case 1:
break 1
case 2:
break 1
|