Skip to content

BLOG

SideScript 2.0: Extended TEMPLATE Syntax

GuideSideScriptTEMPLATE

Learn TEMPLATE syntax for reusable rule groups and WHEN context for external conditions in SideScript 2.0.

SideScript 2.0 introduces the TEMPLATE syntax and WHEN context for creating reusable rule groups.

Version: SideScript 2.0

For basic SideScript syntax, see SideScript Syntax Guide

Coming in Sidefy 2026.1.15

Here’s a quick overview:

TEMPLATE @<identifier>
NAME "<name>"
IF <condition>
[AND|OR <condition>...];
[WHEN <context>
[AND|OR <context>...]]
IF template MATCHES @<identifier>
[AND|OR <condition>...]
THEN <action>;

Note: Conditions within a single IF block must be either all AND or all OR. Mixing AND and OR logic in the same block is not supported.

WHEN Contexts

ContextDescriptionValues
appearanceSystem appearance"dark", "light"
dateDate type"workday", "weekend", "monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "sunday"

Note: Contexts within a single WHEN block must be either all AND or all OR. Mixing AND and OR logic in the same block is not supported.

Example

TEMPLATE @CSVM3
NAME "Tech Media"
IF origin EQUALS_ANY ["9to5Mac", "TechCrunch", "The Verge"];
WHEN date IS "workday"
IF template MATCHES @CSVM3
AND title CONTAINS_ANY ["iPhone", "iPad"]
THEN HIGHLIGHT ["iPhone", "iPad"] WITH "#007aff";