Table of Contents

Macros view

Macros are a powerful feature of Tabular Editor that allow you to automate repetitive tasks or create custom actions for your models. A macro is a script written in C# that can access and manipulate the Tabular Object Model (TOM).

You can create, edit, run and manage macros from the Macros menu in Tabular Editor.

Tip

You can nest your macros in folders by prefixing your macro name in the following pattern FolderName\MacroName

Macro Window
Figure 1: Macro window in Tabular Editor. Provides an overview of all your saved Macros
Note

The macros view displays a list of all macros currently saved in your %localappdata%\TabularEditor3\MacroActions.json file.

  • You can delete a macro by clicking on the "X" button at the top left corner of the view.
  • You can edit a macro by double-clicking on the list item. This will bring up a C# script document containing the code that will be executed when the macro is invoked. To save your changes to the macro, click the "Edit Macro..." toolbar button (see screenshot below) or use the C# Script > Edit Macro... menu item.
  • To create a new macro, start by creating a new C# script, then save it as a macro using the C# Script > Save as Macro... menu item.
Edit Macro Button
Figure 2: When you have a Macro open you can save it back by choosing "Edit Macro..."

Next steps