Conditions Cookbook

Conditions are used in CHS scripts and macros. They support logical operators, parentheses, numeric and string comparisons, regex, and existence checks.

Operators

Examples

# Status
if status:energy eq high and status:focus ne low then echo "green light"

# Item property
if task:"Deep Work":priority > 7 then mark "Deep Work":next

# Regex match
if note:"Journal":tags matches ^.*daily.*$ then echo "daily note"

# Exists
if exists note:"Journal" then echo "Journal exists"
if exists file:User/Settings/Status_Settings.yml then echo "Status settings"