Automations
An automation is a rule on a supertag. When a note changes in a way the rule names, Superliner runs the rule’s steps on that note: adding or removing supertags, setting fields, or checking the box. A command button does the same steps when you press it.
- Set up
- Supertag page ▸ Configure ▸ Automations ▸ Add automation, or Add command button…
- Triggers
- A note gets the supertag, a note is added under it, its box is checked, or its box is unchecked
- Steps
- Add supertag, Remove supertag, Set field, Mark done, Mark not done, Remove checkbox
- Markdown copy
- Each rule is a sentence under Supertag settings, and the Tag definition record keeps it
The four triggers
Open the supertag’s page, fold open Configure, and find the Automations section. Add automation opens a menu with four triggers. Choose one and the step form opens under a heading such as “When #Task is done, do:”.
| Trigger | It runs when | Steps go to |
|---|---|---|
| When #X is added to a note | A note gains the supertag, by Apply Supertag, the # list, or a new note made with it. A supertag it extends counts too. | The note that gained it. |
| When a note is added under #X | A note is made under a note that has the supertag: Return, a new note, or a paste. A paste of many notes runs once per parent. | The parent note, not the new one. |
| When #X is done | A note with the supertag has its checkbox checked. It runs only while the note still has the supertag. | The note whose box was checked. |
| When #X is not done | A checked note with the supertag is unchecked, or its checkbox is removed. | The note whose box changed. |
Automations run for your own changes. They do not run for Undo or Redo, for an import, or for the copies a template makes. A supertag in Trash runs no rules until it is restored.
The steps
| Step | What it does | When it does nothing |
|---|---|---|
| Add supertag | Applies the supertag, with its defaults, child templates and its own triggers. | The note already has it. |
| Remove supertag | Takes the supertag off the note. The note’s field values stay. | The note does not have it. |
| Set field | Sets a field to a value. Option and Yes/No fields offer a pop-up; text, number, URL, email, date and timestamp fields take a typed value. | The note already holds that value, or the value no longer fits the field. |
| Mark done / Mark not done | Checks or unchecks the note’s box. A note with no box gets one. | The box is already in that state, or the note cannot have a box. |
| Remove checkbox | Takes the note’s box away. Its text and children stay. | The note has no box. |
The Set field target lists fields that are not in Trash, of the types above. Note, list and Tags fields are not offered: a step never stores a reference to a note. A typed date is fixed when you add the step: a word such as tomorrow becomes that day, and the form says which day. A date range takes an optional End box in workspaces that support ranges.
Command buttons
Add command button… asks for a name, up to 80 characters on one line, and the first step. Add is off until the name has text. A command button appears on every note that has its supertag, or a supertag that extends it.
On a note, a command button sits at the right end of its row and shows when you hover over the row or focus it with the keyboard. One command shows its name. Several commands show a Commands menu. A tagged note’s page header shows the same buttons in full. Pressing one runs its steps on that note as one undo step, named after the button, and the triggers those steps set off run too.
If the steps would change nothing on the note, Superliner says “…” has nothing to change on this note, and does nothing else. Pressing a button on the supertag’s own page explains where it is used, because there is no note to run it on there.
Build and change the rules
Under each rule, Add Step adds a step to the end of it. Each step has Up, Down and Remove. Removing the last step removes the rule. Up and Down on a rule move it among the rules of its kind. Each change is one undo step.
A rule and its steps cannot be edited in place. To change a trigger, a step or a command button’s name, remove it and add it again.
A trigger’s steps can set off other triggers. One change follows at most three levels, and at most 50 steps and 10 Add supertag steps in all. When a limit stops the chain, your change is kept, and Superliner says so with the notice Automation stopped: too many steps.
Two notices can appear. Automation skipped means the automatic steps could not be applied with your change, for example because the note is open for editing in another pane. Your change is kept in both cases.
Combine it
- A done task that files itselfWhen #Task is done, add #Archived. A checked task gets #Archived with no extra step.
- A new meeting with its structureA child template gives each meeting its headings. An automation on the same supertag can set its Status when a note gets it.
- Automations and inheritanceA parent’s rules and command buttons run on notes with a subtype, so a shared rule is written once.
- Automations and the checkboxA box that a field moves does not run the Done or Not done triggers. A box you check or uncheck does.
Limits
- Automations never delete a note. Their steps add or remove supertags, set field values and change checkboxes.
- Up to 20 triggers and 20 command buttons on one supertag, and up to 20 steps in each rule.
- Command buttons cannot be renamed. Remove one and add it again to change its name.
- A rule’s steps cannot refer to a note. Note, list and Tags fields are not offered in Set field.
- The Markdown copy writes each rule as a sentence under Supertag settings. Edits to the Markdown copy are not read back.