Macros
AdvantageBuilder uses two macro systems: Main Macros for automation logic, and Macro GUI for HTML‑based user interfaces. This page explains how they differ, how they work together, and how macros are organised, executed, and scheduled.
Main Macros
Main Macros contain the automation logic of AdvantageBuilder. They run scripts, call other macros, interact with databases, generate files, launch GUI pages, and perform workflow automation.
Where Main Macros Live
Main Macros appear in the Macros ‑ Main tab page inside the application. This screen includes:
- Folder Tree – organise macros into folders and subfolders
- Macro List – shows macros inside the selected folder
- Action Tabs – Recent History, Search, Run on Start, Run on Close, Scheduled
- Context Menus – Run, Run Async, Open/Edit, Delete, Rename, Cut/Copy, Add Schedule
The Open/Edit menu item launches the Macro Editor, which is a separate screen.
Execution Modes
- Run – executes the macro synchronously
- Run Async – executes the macro asynchronously
- Run on Start – executes automatically when AdvantageBuilder starts
- Run on Close – executes automatically when AdvantageBuilder closes
Scheduling
Main Macros support built‑in scheduling. You can schedule macros to run:
- Minutes
- Hours
- Daily
- Weekly
- Monthly
- At specific times
Scheduling is managed through the Scheduled tab in the Main Macros screen.
Organisation
Macros can be organised into folders and subfolders. Folder operations include:
- New Folder
- New Macro
- Paste
- Delete
These operations belong to the Main Macros tab page, not the Macro Editor.
Macro GUI
Macro GUI contains HTML‑based user interface macros. These are mini web pages that run inside AdvantageBuilder and allow you to build forms, dashboards, wizards, and interactive tools.
Where Macro GUI Lives
Macro GUI files appear under the MacroGUI folder in the Macros ‑ GUI tab. They are edited using the HTML GUI Editor, which is a default text editor for HTML, CSS, JavaScript, or other text files.
Launching Macro GUI Pages
Macro GUI pages are displayed using the following functions:
- showHTMLForm(url)
- launchHTMLForm(url)
- launchHTMLFormEdge(url)
These functions show the GUI page to the user.
Loading HTML Documents (Not Displayed)
The following functions load HTML documents for parsing or processing, but do not display them:
- loadHTMLDocument(url)
- loadHTMLDocumentEdge(url)
These return an HTMLDocument or HtmlAgilityPack document.
Passing Parameters to Macro GUI
AdvantageBuilder supports three mechanisms for passing parameters from Main Macros to GUI pages:
- Query Strings – appended to the URL and accessed via
QueryString["name"] - GUI Parameters – stored using the GUI Parameters Object Model and accessed via
macroGUIParams["name"] - Macro Arguments – passed directly to
launchHTMLForm(url, params)and accessed viaargs.name
These mechanisms can be used independently or together.