Sievesmith

Editing rules

Besides the text, Sievesmith can show a script as a list of rules, similar to the rules in Apple Mail. Switch with Text | Rules in the editor’s toolbar; the choice is remembered per script on this device. Both views edit the same script and the same draft, and Undo works across both.

The list of rules

Section headings come from separator comments in the script, for example a line of ##### with a title line below it. Each rule shows:

The bar above the list shows the number of rules (Rules: n) and has Expand All / Collapse All, Move Rule Up / Move Rule Down (⌘↑ / ⌘↓ for the selected rule) and Add Rule. You can also drag rules to a new position.

Editing a rule

Expand a rule to edit it. At the top is its Name field. Below come, for each branch of the rule (If, Otherwise, if, Otherwise), its conditions and then its actions. Rules nested in a rule appear indented.

Mac: The rules view: an expanded rule with the condition Header List-Id contains swift.org and the actions File into Lists/Swift and Stop
iPad: The rules view: an expanded rule with the condition Header List-Id contains swift.org and the actions File into Lists/Swift and Stop
iPhone: The rules view: an expanded rule with the condition Header List-Id contains swift.org and the actions File into Lists/Swift and Stop

Conditions

For a list of conditions, choose All conditions are met or Any condition is met. Each condition is a row of field, comparison and value:

⊖ removes a condition, Add Condition adds one.

Actions

After then: come the actions: File into (with Keep a Copy and Create Folder), Redirect to (with Keep a Copy), Keep, Discard, Stop, Add / Set / Remove Flags, Reply and Set Variable. ⊖ removes an action, Add Action adds one.

Values

Separate several values with a comma and a space (", “). A value takes effect when you press Return or when the field loses focus. On iPhone the fields of a row are stacked.

What changes in the script

An edit changes only the affected text; comments and formatting elsewhere in the script stay as they are. The require lines the script needs are added and removed automatically, in the script’s style: a script with one require per extension keeps it that way.

Anything the form cannot show stays in the list as an editable text block; Apply applies your changes to it.

Without a subscription you can edit rules as a local draft; uploading them needs Sievesmith Pro.