Tutorial

Getting Started with Macros

Macro Editor

User Interface

Menus and Toolbar

Editing Macro Statements

Expression Editor

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: March 19, 2023
Also available as a single HTML file

Onetastic Macro Documentation > Macro Editor > Editing Macro Statements

Editing Macro Statements

Inserting, Removing and Moving Macro Statements

Macro Editor has a set of statement buttons and a large pane that contains the contents of the current macro. You can use the statement buttons (Alt+1 to Alt+9) to insert new statements to the macro and use Delete key to remove them from the macro. You can also use the up/down buttons on the right to move the statements up and down as well as in an out of parent statements. The statements can be collapsed/expanded using the little arrows to the left of them.

Editing Individual Statements

Each statement has one or more editable parts. To edit them click on those parts or use the keyboard shortcuts explained below. Below image shows the editable parts of the statement in red rectangles.

Editable areas in statements

Keyboard Shortcuts

Most statements contain a single expression which can be edited by pressing the Enter key. For statement consists of 3 expressions, each of which can be edited by Enter, Ctrl+Enter and Ctrl+Alt+Enter keys respectively. ForEach statement consists of a loop variable and a array expression. The loop variable can be edited by the Enter key while the array expression can be edited by Ctrl+Enter key. There are some other keyboard shortcuts for various operations:

Shortcut Action
1 to 9 Insert statement
Enter Edit the expression in the selected statement
Ctrl+Enter Edit the conditional expression of the selected For statement or the array expression of the selected ForEach statement
Ctrl+Alt+Enter Edit the increment expression of the selected For statement
Ctrl+Up Move selected statement up
Ctrl+Down Move selected statement down
Left Arrow Collapse selected statement
Right Arrow Expand selected statement
Delete Delete the selected statement

Reference

Statements

For

ForEach

If

Else If

Else

Switch

Case

Default

While

Expression

Comment

Break

Continue

Return

Hierarchy Objects

NotebookRoot

Notebook

SectionGroup

Section

Page

Page Objects

Title

Outline

Table

Column

Row

Cell

Paragraph

Text

Image

EmbeddedFile

Tag

Other Objects

DialogBox

MacroMenu

Window

Functions

Array Functions

Color Functions

Data Store Functions

Date/Time Functions

Dialog Box Functions

Macro Execution Functions

Macro Menu Functions

Object Functions

String Functions

Window Functions