Macro Editor
The Macro Editor is where you write and edit the logic of Main Macros. AdvantageBuilder macros support multiple scripting engines, template language, including AdvantageBuilder’s automation APIs.
Overview
The Macro Editor opens when you select a macro in the Main Macros tab and choose Open/Edit. It provides a full editing environment for writing automation logic using:
- JScript
- JavaScriptV8 (ClearScript V8)
- PowerShell Script
- Template Language
The editor supports syntax highlighting, code templates, snippets, and integration with AdvantageBuilder’s automation APIs.
Editor Layout
The Macro Editor layout typically includes:
- Script Area – the main code editing window
- Smart, Extensible Point-and-Click Menu – point and click on the menu item to insert code snippets directly into the Scripting Area, or run a Helper Macro that generates code dynamically, and automatically inserts it into the scripting area. The menu can be edited and extended. In edit mode, menu items can be added, deleted, amended, moved around by drag-and-drop feature, or moved up and down to change the order.
- Toolbar buttons – contains the following buttons Save, Cut, Copy, Paste, Undo, Indent (left/right), Text Search, Zoom (in/out) ,Bold, Italic, Underline, JScript Snippet Library, JS Syntax browser, Run Macro
- JScript Snippet Library – insert reusable code blocks
- Run Macro – execute the macro directly from the editor
The editor is designed for both beginners and advanced users, providing point‑and‑click insertion of common constructs while allowing full scripting flexibility.
Scripting Engines
AdvantageBuilder supports multiple scripting engines inside the Macro Editor. Each engine has its own capabilities and helper functions.
JScript
The classic Windows JScript engine. Supports AdvantageBuilder’s JavaScript helper APIs.
JavaScriptV8 (ClearScript)
A modern JavaScript engine with high performance and full access to AdvantageBuilder’s V8 helper APIs.
PowerShell Script
Full PowerShell scripting with access to AdvantageBuilder’s PowerShell helper APIs.
PowerShell Script (STA)
Single‑threaded PowerShell mode for UI‑related automation.
Template Language
A powerful templating system that mixes script blocks with text generation. See Template Language Reference.
Code Features
The Macro Editor supports:
- Syntax highlighting
- Code indenting
- Snippets insertion
- Point-and-Click coding
- Helper Macro Integration for dynamic code generation
- Scripting Syntax Helpers
Running Macros from the Editor
The Macro Editor includes a Run button that executes the macro immediately. This is useful for testing logic without returning to the Main Macros tab.
Execution from the editor uses the same engine and environment as execution from the Main Macros tab.
Saving Macros
Macros are saved directly into the folder structure shown in the Main Macros tab. Saving updates the macro file and makes it available for execution, scheduling, and GUI integration.