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

Copying and moving objects

Asking for user input

Storing persistent data

Using binary data

Sorting objects

Macro menus

Bulleted and numbered lists

Accessing the file system

Accessing the clipboard

Sample Macros

Concepts

Code Structure

Expressions

Objects

Properties

Variables

Data Types

Arrays

Functions

Literals

Operators

Comments

Last updated on: May 12, 2026
Also available as a single HTML file

Onetastic Macro Documentation > Concepts > Comments

Comments

You can provide comments in your macros to improve readability and explain what your code does. Onetastic Macro Language supports two types of comments:

  • End-of-line comments starting with // - Everything after // to the end of the line is a comment
  • Inline comments enclosed in /* ... */ - Can appear anywhere within a line, including within expressions

End-of-Line Comments

End-of-line comments begin with // and extend to the end of the line. This is the most common way to add comments:

Copied!
// Create and configure a dialog box $dialog_box = DialogBox_Create("") // Add user input fields DialogBox_AddTextBox($dialog_box, "&Find what", $Search, "", false) // find box DialogBox_AddTextBox($dialog_box, "&Replace with", $Replace, "", true) // replace box $Options = Array("Current page", "Current section", "Current notebook") DialogBox_AddDropDown($dialog_box, "&Scope", $Scope, "Current section", $Options) DialogBox_AddCheckBox($dialog_box, "Match &case", $MatchCase, false) DialogBox_Show($dialog_box) // Show the dialog

Inline Comments

Inline comments are enclosed in /* ... */ and can appear anywhere within a line, including within expressions. They cannot span across multiple lines:

Copied!
/* Add user input fields */ DialogBox_AddTextBox($d, "&Find", $Search, "" /*initialValue*/, false /*emptyOK*/) DialogBox_AddTextBox($d, "&Replace", $Replace, "" /*initialValue*/, true /*emptyOK*/)

Commenting-Out Code

Comments can be used to temporarily disable code. You can use either // or /* ... */ to comment out one or more lines:

Copied!
// Create a new dialog box $dialog_box = DialogBox_Create("") // Add some controls DialogBox_AddTextBox($dialog_box, "&Find what", $Search, "", false) DialogBox_AddTextBox($dialog_box, "&Replace with", $Replace, "", true) // For now we don't have following controls: // $Options = Array("Current page", "Current section", "Current notebook") // DialogBox_AddDropDown($dialog_box, "&Scope", $Scope, "Current section", $Options) /* DialogBox_AddCheckBox($dialog_box, "Match &case", $MatchCase, false) */ // Show the dialog box DialogBox_Show($dialog_box)

Reference

Statements

Hierarchy Objects

Page Objects

Other Objects

Functions

Array Functions

Clipboard Functions

Data Store Functions

Data Type Specific Functions

Date/Time Functions

Dialog Box Functions

File System Functions

Macro Execution Functions

Macro Menu Functions

Object Functions

Special Functions

String Functions

Window Functions