A comprehensive guide to SideScript, the domain-specific language for defining event rules in Sidefy.
SideScript is a domain-specific language designed for defining event rules.
Version: SideScript 1.7
Here’s a quick overview:
IF <condition> [AND|OR <condition>...]THEN <action> [<action>...];Note: Conditions within a single IF block must be either all
ANDor allOR. MixingANDandORlogic in the same block is not supported.
Fields
| Field | Description |
|---|---|
| title | Event title |
| content | Event content |
| origin | Origin |
| source | Plugin |
| anywhere | Event title, content, origin or plugin |
Operators
To illustrate how these operators work, let’s assume we have the following Common Dataset:{"apple", "banana", "pineapple", "strawberry", "bad apple"}
| Operator | Description | Example Logic | Matched Results |
|---|---|---|---|
| EQUALS | Equals | EQUALS "apple" | {"apple"} |
| NOT EQUALS | Not equals | NOT EQUALS "apple" | {"banana", "pineapple", "strawberry", "bad apple"} |
| EQUALS_ANY | Equals any | EQUALS_ANY ["apple", "banana"] | {"apple", "banana"} |
| NOT_EQUALS_ANY | Not equals any | NOT_EQUALS_ANY ["apple", "banana"] | {"pineapple", "strawberry", "bad apple"} |
| CONTAINS | Contains | CONTAINS "apple" | {"apple", "pineapple", "bad apple"} |
| NOT CONTAINS | Not contains | NOT CONTAINS "apple" | {"banana", "strawberry"} |
| CONTAINS_ANY | Contains any | CONTAINS_ANY ["apple", "berry"] | {"apple", "pineapple", "strawberry", "bad apple"} |
| NOT CONTAINS_ANY | Not contains any | NOT CONTAINS_ANY ["apple", "berry"] | {"banana"} |
| CONTAINS_ALL | Contains all | CONTAINS_ALL ["pine", "apple"] | {"pineapple"} |
| NOT CONTAINS_ALL | Not contains all | NOT CONTAINS_ALL ["pine", "apple"] | {"apple", "banana", "strawberry", "bad apple"} |
Actions
| Action | Variables | Description |
|---|---|---|
SET color = {color} | color: “#RRGGBB” | Event color |
SET symbol = {symbol} | symbol: “star.fill” | SF Symbol icon |
SET PINNED | - | Pin to top |
SET HIDDEN | - | Hide event |
HIGHLIGHT {text_array} WITH {color} | text_array: [“example1”, “example2”]color: “#RRGGBB” | Highlight keywords with color |
REPLACE {text_array} WITH {replacement} | text_array: [“old1”, “old2”]replacement: “new” | Replace text content |