Both notes and agents can have actions. Actions can be applied to self via a rule or edict, or be applied to new/newly add:
- note(s), including container(s)
- map adornments
- agents and their child aliases
- map smart adornments (action is applied to items 'on' the adornment)
In their original design use, the parent (with the action) acts on its children. In this regard a note/container $OnAdd is the functional equivalent of $AgentAction. Indeed, the Action Inspector's 'Action' tab shows the $AgentAction code for a selected agent or the $OnAdd code for a note.
A special form of Action called a Rule can be used to act just on the note/agent itself. Values of attributes are changed and information is gathered or changed as a result; the value of (system) read-only attributes may not be altered by action code. Any resulting effects are applied only to the children. Rules are actions that only affect the note itself.
Agents may have actions.
All code-editing text fields use the default value of $CodeFont for the current document.
Actions and rules may use simple arithmetic and logical expressions, written in action code as expressions. A broad range of functions can be run at action/rule scope often removing the need to use export codes.
But there are a number of action code contexts: see a listing of Action-type system attributes.
A further, easily overlooked context for action use is link actions.
The core build-in types of action are: