Tutorial

Getting Started with Macros

Macro Editor

User Interface

Menus and Toolbar

Editing Macros

Macro Debugging

How To

Using variables

Finding and modifying objects

Creating new page content

Asking for user input

Storing persistent data

Using binary data

Sorting objects

Macro menus

Bulleted and numbered lists

Sample Macros

Concepts

Expressions

Objects

Properties

Variables

Data Types

Arrays

Functions

Literals

Operators

Comments

Last updated on: September 02, 2024
Also available as a single HTML file

Onetastic Macro Documentation > Functions > Dialog Box Functions > 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.

Remarks

A task dialog contains a title, a message and a set of command buttons. It may look like this:

Example Task Dialog

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: // User selected first option break 1 case 1: // User selected second option break 1 case 2: // User selected third option break 1

Reference

Statements

Hierarchy Objects

Page Objects

Other Objects

Functions

Array Functions

Color Functions

Data Store Functions

Date/Time Functions

Dialog Box Functions

Macro Execution Functions

Macro Menu Functions

Object Functions

Special Functions

String Functions

Window Functions