Skip to content

Macro Action

Material Foundry edited this page May 28, 2023 · 8 revisions

The Macro action allows you to trigger macros.
See the image below for an example on how to set up a hotkey macros in a token control screen. It has been taken from the provided example XL profile.

Only the lower left section of the screen is set using the Macro action, the others are set with the Token and Move actions.

Module Configuration

When using the 'Macro Board' mode, you need to set up the macro board in Foundry. This is done in the Foundry module settings. At the top you will find the 'Macro Configuration' button. Clicking it opens the configuration screen, as shown below.

The screen is divided into a number of boxes, each labeled 'Macro #', where each represents a single macro and its settings. The number of macros you can see depends on what Stream Deck model you've set up in the module configuration.

For each macro there are 3 options: Macro selection, furnace arguments (only if 'the Furnace' is installed) and background.

Macro Selection

This is a drop-down menu, where you can select a macro from your macro directory (which you can find by pressing the 'file' icon to the left of your macro hotbar).

Macro Arguments

Starting in Foundry v11 macro arguments are supported in the core. In Foundry v10 the module Advanced Macros is required.
Here you can fill in any arguments that you want to use.

Macro Arguments in Foundry v11

In Foundry v11 you enter objects as macro arguments, which can be retrieved in the macro from the scope object, for example, scope.x.

Take the following macro to move the selected token to coordinates x and y:
token.document.update({x: scope.x, y: scope.y})
If you want to call this macro from the Stream Deck to move the token to x=1000 and y=1500, you'd use the following arguments:
{"x":1000, "y":1500}
Please note that you must include the quotation marks around the object keys.

Macro Arguments using Advanced Macros

Please read the Advanced Macros documentation.
If, for example, you wanted to execute a macro named 'My Macro' with the arguments 'argument1 argument2 argument3', you would use for example /"My Macro" 100 50 "test" in the chat. In the macro configuration screen you would only fill in the arguments, so: 100 50 "test".

Background Color

Clicking the colored box you'll be presented with a color picker. Selecting a color will set that color as the background color for the button.

Stream Deck Configuration

Mode

Select the mode of the button

  • Hotbar - Execute macros from the hotbar
  • Visible Hotbar - Execute macros from the macros that are currently visible in the hotbar
  • Custom Hotbar - Execute macros from the Custom Hotbar module
  • Macro Board - Execute a macro as set in the 'Macro Configuration' in the module settings

Mode: Hotbar/Visible Hotbar/Custom Hotbar

At the bottom of the Foundry screen there is a hotbar, where you can place macros. Using the 'hotbar' or 'visible hotbar' mode you can execute one of these macros. The difference between these modes is that when you select the macro by number, in the 'hotbar' mode, the button will execute the macro at that number regardless of which macros are currently shown on screen. So the macro you execute doesn't change when you scroll through the different hotbar pages. In the 'visible hotbar' mode, the macro you execute is the one that is currently visible, so it does change when you scroll through the hotbar pages.

The Custom Hotbar option allows you to trigger macros from the hotbar that is provided by the Custom Hotbar module.

These functions are compatible with the Token Hotbar module, which allows you to assign a hotbar for each token. So this automatically changes the hotbar when a different token is selected.

Macro Number

The macro to execute. In 'hotbar' mode, this is a value between 1 and 50. In 'visible hotbar' this is a value between 1 and 10. 10 corresponds with the macro at location 0 in the Foundry hotbar.

Background

Sets the background color of the button. The icon needs to have transparent parts (so no jpeg).

Mode: Macro Board

Type: Trigger Macro

Trigger a macro from the macro board, as set in the Macro Configuration screen (see above).

Macro Number

The macro to execute. The number corresponds with the macro number in the Macro Configuration.

Background

Sets the background color of the button. The icon needs to have transparent parts (so no jpeg).

Type: Offset

With offset you can give the macro number an offset allowing easy switching between displaying different macros.

Offset

Sets the amount the macro number needs to be offset when the button is pressed

On Color

Sets the color of the ring that's shown on the button when the offset is set to the value set in the offset box.

Off Color

Sets the color of the ring that's shown on the button when the offset is set to the value set in the offset box.

Background

Sets the background color of the button. The icon needs to have transparent parts (so no jpeg).

Mode: By Name

This mode allows you to call a macro by its name. If there are multiple macros with identical names, it will pick the first one it finds.

Macro Name

The name of the macro. It needs to be identical to the name in Foundry and is case sensitive.

Macro Arguments

This function allows you to add arguments to the macro.
See this section on macro arguments for more information.

Display Name

Toggles whether or not the button should display the macro's name.

Display Icon

Toggles whether or not the button should display the macro's icon.

Display Uses

Requires Illandril's Hotbar Uses to be installed, it does not need to be active.
Allows you to display item uses, spell slots, or item count if the macro is a item or spell macro.