The Action tab is used to set the OnAdd ($OnAdd) action of notes and adornments or the agent action ($AgentAction) of agents.
The main input box is used for adding or editing the action code. Pressing the Return key (↩) commits any changes made and runs (or updates) the query. The code box has auto-completion for action code and attribute names (based on using a $-prefix). The code box supports syntax colouring.
Code fields do not select the entire text after when gaining focus or after pressing the Return key (↩) to update (save changes). This lessens the chance of accidental deletion of existing code.
Note that an agent's query, action and priority can also be set from the agent tab of the Get Info pop-over.
OnAdd also affects adornments created or pasted into containers.