An edict is essentially a rule—in terms of scope—but one which is run very occasionally. It is akin to an agent set to a low priority. There is no priority control for edicts. They are designed for background work, i.e. housekeeping tasks that need to run occasionally but not often enough to have impact in the more pressing rules.
A note or agent's rule is stored in $Edict.
Edicts may be overridden locally in a note by using $EdictDisabled.
A note's edict runs once when it is:
- first created.
- edited (practically, this means when selected).
All edicts run once when:
- a Tinderbox document is first opened.
- roughly once an hour for the rest of the session (i.e. while the document remains open).
- when File menu, Update Agents Now is clicked (i.e. both agents and edicts are refreshed once).
- when the Run Now button on the Edict Inspector is pressed.
- when the note's $Text or Displayed Attributes' values are changed. N.B. this misses a number of changes the user might assume are a trigger, but are not, although a little code review might offer a solution:
- changes to attributes that are not Displayed Attributes. Consider: make the attribute a Displayed Attributes.
- changes in other notes' attributes that this note might be checking/listing. Consider: shifting the action to the note being changed. Instead of a parent checking its children for changes, make the children update the parent if they change.
- dynamic changes to in-doc links (i.e. auto-creation/deletion of links).
See also—notes linking to here: