With Quick Scripts, you can save programming time by writing short Lua scripts directly into a Run Script action. Quick scripts are also supported in the Script condition, allowing you to check a variable or query a statement in no time.
Quick Scripts are available in Designer 2.12 and later.
Getting started with Quick Script Actions
From the Trigger tab in Designer 2, select one of your project’s triggers and add a new Run Script action.

In the Action pane, notice that Quick Script is available immediately. From here, you can start writing your Lua script straight away.
Note: Quick Scripts work best for short scripts which are not reused throughout your project.

To use a longer script, or to create a script which can be used by other triggers in the same project, use the script selection drop-down to select an existing script from the project, or click ‘New Script’ to open the script editing dialog.
Tip 💡: Designer 2 compiles Quick Scripts and reports any errors as project issues. Click the exclamation mark in the top right corner of the Designer window to check for project issues.
Using Quick Script Conditions
Quick Scripts are also available as a trigger condition, useful for quickly querying a variable or function in your project.
To get started with Quick Scripts in conditions, select a trigger from your project’s Trigger tab and create a new Script condition. From here, Quick Script is available immediately.

Use the Condition field to write your Lua condition. The condition will be accepted, and any associated actions will run if the Quick Script returns true.
Tip 💡: Use the ‘Negate’ checkbox to accept the condition if the Quick Script returns false.
Example: Randomly run an action
Using Quick Scripts, it’s easy to create a condition which will run an action according to a random number generator.

The Quick Script return math.random(5)==1 will randomly run the trigger when a random value between 1 and 5 equals 1. That means the action will run in around 20% of cases.
For more information on Quick Scripts, take a look at our Designer 2 online help.

