SideScript becomes NuncScript in version 3.0. Combine conditions, match and replace with regex, delete matched text, and import legacy rule files.
SideScript becomes NuncScript in version 3.0. This version adds condition groups, regex matching, and regex replacement on Mac, iPhone, and iPad.
Version: NuncScript 3.0
For basic syntax, see SideScript Syntax Guide. Earlier guides use the former name SideScript.
For TEMPLATE and WHEN, see SideScript 2.0. For AI conditions, see SideScript 2.1: AI Decision.
Here’s a quick overview:
IF <condition> AND (<condition> OR <condition>...)THEN <action>;
<field> [NOT] REGEX "<pattern>"REGEX_REPLACE ["<pattern>", ...] WITH "<replacement>"Condition Groups
Parentheses let a group choose its own AND or OR logic. Groups work in rules and templates, using the same fields and operators, including AI_DECISION. NOT applies to individual conditions, not to a whole group.
Note: Each IF level must use either all
ANDor allOR. Only one level of groups is supported. Groups cannot be empty or contain other groups. WHEN conditions keep their own logic and do not support groups.
In the rule editor, use Add condition group to create a group. For example, this rule colors events from 9to5Mac when the title contains iPhone or the content contains iPad:
IF origin EQUALS "9to5Mac" AND (title CONTAINS "iPhone" OR content CONTAINS "iPad")THEN SET color = "#007aff";Operators
REGEX "pattern" searches a text field using a regular expression. NOT REGEX matches when the pattern does not match. Matching ignores case by default; use (?-i) for case-sensitive patterns and ^ / $ to match the whole string.
Title conditions check both the current and original title. Content conditions inspect the first 500 characters of each notes variant.
Actions
REGEX_REPLACE ["pattern"] WITH "replacement" replaces all matches in the current title and notes. Use $1, $2, and so on to insert captured groups. Each referenced group must exist in the pattern.
Both REPLACE and REGEX_REPLACE accept an empty replacement to delete matched text. Leave the replacement field blank in the editor, or write WITH "" in a script. Omitting the replacement string or the entire WITH clause also means deletion; exports always write WITH "" explicitly.
Ordinary replacement is literal and case-sensitive. Regex replacement ignores case by default. Patterns run in list order; ordinary replacement runs before regex replacement, followed by highlighting. Replacement changes displayed text, not the source data or original untranslated fields.
Escaping: In a script string, write
\\d+; in the app’s regex input field, enter\d+. To insert the literal text$1, enter\$1in the replacement field or write"\\$1"in the script.
Import and Export
Exports use .nuncscript and start with # NuncScript 3.0. Imports also accept legacy .sidescript files and # SideScript headers. Files with version headers older than 3.0 retain their original backslash handling.
To import the examples below as a file, add # NuncScript 3.0 as the first line and save with the .nuncscript extension. Keep semicolons between rules. For MCP, pass one rule body without the header or trailing semicolon; the argument name remains sidescript for compatibility.
Imported rules receive new identities and are enabled by default. Template IDs are retained; an existing template with the same ID is updated. Older apps do not support the new file format or 3.0 features.
Examples
Match
Hide events titled Release 42, but not Release notes:
IF title REGEX "^Release\\s+\\d+$"THEN SET HIDDEN;Replace
Change Release 42 to Version 42, keeping the captured number:
IF title CONTAINS "Release"THEN REGEX_REPLACE ["Release\\s+(\\d+)"] WITH "Version $1";Delete
Remove a literal prefix: Meeting: Planning becomes Planning.
IF title CONTAINS "Meeting"THEN REPLACE ["Meeting: "] WITH "";Remove a regex-matched prefix: [Draft] Proposal becomes Proposal. This example omits WITH "":
IF title CONTAINS "Draft"THEN REGEX_REPLACE ["^\\[Draft\\]\\s*"];