Getters

Some components have designated getter properties, which allow their value to be obtained into args or variables during actions.

id

If a component has an id assigned to it, you can access a getter directly from a triggered action on any component via {value:id.property}.

Example

A picker is configured with "id": "mypicker", get the selected item's value property from any action:

"action": {
  "type": "script",
  "src": "./actioned.zsh",
  "args": [
    "{value:mypicker.selected.value}"
  ]
}

A label is configured with "id": "mylabel", get its text property from any action:

"action": {
  "type": "script",
  "src": "./actioned.zsh",
  "args": [
    "{value:mylabel.text}"
  ]
}

self

When getting the value for a component in an action configured for that same component, it bypasses the need for an id. Values can be accessed directly using {value:self.property}.

Example

A checkbox without an id, getting the value using self when the value is changed:

{
  "type": "checkbox",
  "text": "Tick me!",
  "events": [
    {
      "triggers": "changed",
      "action": {
        "type": "script",
        "src": "./changed.zsh",
        "args": [
          "{value:self.checked}"
        ]
      }
    }
  ]
}