Tutorial

Getting Started with Macros

Macro Editor

User Interface

Editing Macro Statements

Expression Editor

How To

Using variables

Finding and modifying objects

Creating new page content

Asking for user input

Sorting objects

Macro Logging

Sample Macros

Concepts

Expressions

Objects

Properties

Variables

Data Types

Arrays

Functions

Literals

Operators

Comments

Using variables

Macro language has variables, for temporarily storing and manipulating information. Variables can be of various types including objects and arrays. Variables are named with a dollar sign ($) followed by an identifier. The valid characters in the variable name are a-z, A-Z, 0-9 and underscore (_). Following macro demonstrate use of variables to store the list of cells in a page and to store the text of the first cell to fill the rest of the cells with:

$Cells = QueryObjects("Cell", GetCurrentPage()) $i = 0 ExpandForEach ($Cell in $Cells) ExpandIf ($i == 0) $TextOfFirstCell = $Cell.text ExpandElse $Cell.text = $TextOfFirstCell $i += 1

Here $Cells, $Cell, $i, $TextOfFirstCell are all variables storing an array of Cell objects, a Cell object, an integer, and a string respectively.

Reference

Statements

ForEach

If

Else

While

Expression

Comment

Break

Continue

Hierarchy Objects

NotebookRoot

Notebook

SectionGroup

Section

Page

Page Objects

Title

Outline

Table

Column

Row

Cell

Paragraph

Text

Image

EmbeddedFile

Tag

Other Objects

DialogBox

Functions

Array Functions

Date/Time Functions

Dialog Box Functions

Macro Execution Functions

Object Functions

String Functions