Scripts
Included with Macro DeckBuild a set of actions once as a script and run it from any button, automation or other script.
A script on the Scripts page with a Wait and a Press Key / Combination action
- Reuse the same actions on many buttons
- Give each caller its own input values
- Change a script once, every button follows
- Built in and always on, nothing to set up
Scripts is built into Macro Deck and always on. It adds the Run Script action, which runs one of your scripts and waits for it to finish. A script is a set of actions you build once on the Scripts page and then run from as many buttons, automations and other scripts as you like. When you change the script, every place that runs it uses the new version.
Inputs
A script can declare inputs: values the caller fills in when it runs the script. An input has a name, a type (Text, Numeric, Boolean or Color) and an optional default. Inside the script you read it like a variable, for example {{ vars.scene }}. When you choose the script in Run Script, its inputs appear as fields in the action, so each button can pass its own value.
A script can also be marked Runs on a widget. Then "This widget" inside the script targets whichever widget ran it, so one script can change the button that pressed it.
Example setups
- A Go live script switches the OBS scene, starts the stream and changes the deck to your streaming profile. Three buttons on different profiles run it with Run Script.
- A Switch scene script with a text input
sceneis run by one button per scene, each with its own scene name. - An automation on a Schedule event runs the same script as a button, so you can start it by hand or at a set time.
Scripts can be run from other places too. Any device signed in to Macro Deck can list and run every script that does not run on a widget, with its own input values. On iPhone and iPad, Macro Deck Companion does this from Shortcuts or Siri. To run a script on another computer that runs Macro Deck, use Run Script on another PC of Macro Deck Delegate.
Scripts does not appear on the Integrations page and has no setup dialog. Its Scripts category is always in the Add action dialog.
What you need
- Macro Deck 3
- At least one script on the Scripts page
Set it up
Step 1: Create a script
In the sidebar, click Scripts and then +. In the New script dialog, enter a Name, for example Start streaming, and optionally a Description, then click Create script.
Step 2: Add the actions
On the Actions tab, click + Add action and add the actions the script should run, in order. Click Save changes when you are done. Run tries the saved script right away.
Step 3: Add inputs if you need them
On the Inputs tab, click Add input for each value a caller should fill in. Set its Name, Type and, if you want, a Default. Use it in the actions as
{{ vars.<name> }}. Click Save changes.Step 4: Run the script from a button
On the Deck page, make sure the deck is unlocked (the button at the top right reads Lock) and click a button. The editor opens with Short Press selected. Click + Add action, choose Scripts on the left of the Add action dialog and pick Run Script. Pick your script under Script and fill in its inputs.
Step 5: Press the button
Click Save and press the button. The script runs, and Run Script finishes when the script does.
Actions1
Put these on a button or run them from a flow.
- Run Script
- Runs one of your scripts, with its input values, and waits for it to finish.
Frequently asked questions
Do I have to turn on the Scripts integration?
No. It is built into Macro Deck and always on. It does not appear on the Integrations page, and Run Script is always in the Add action dialog.
What happens to buttons when I delete a script?
They do nothing afterwards. Before you delete a script, Macro Deck tells you which widgets and other scripts run it.
Why does Run Script say no script was selected?
The action has no script chosen under Script. Open the action and pick one.
Can I run a script on another computer?
Yes, with Macro Deck Delegate. Its Run Script on another PC action runs a script on another computer that runs Macro Deck.
Does a run use my unsaved changes?
No. A run always uses the saved script. Click Save changes first.
More in Macro Deck
Macro Deck Companion
Included with Macro DeckControl the phones and tablets that run the Companion app: brightness, rotation, screen and screenshots.
Macro Deck Delegate
Included with Macro DeckRun scripts on another PC running Macro Deck and use the variables it shares.
Variables
Included with Macro DeckChange your variables from buttons and automations, and write any variable to a file.