Options
"options": [ { "key": "use24Hour", "label": "24-hour time", "kind": "toggle", "defaultValue": "true" }, { "key": "city", "label": "City", "kind": "text", "defaultValue": "Paris" }, { "key": "style", "label": "Style", "kind": "choice", "defaultValue": "full", "choices": ["full", "compact"], "choiceLabels": ["Full", "Compact"] }]Fields
Section titled “Fields”| Field | Type | Required | Description |
|---|---|---|---|
key |
string | yes | The option’s name in tokens ({key}), visibleWhen ("key=value") and scripts (context.options.key) |
label |
string | yes | Shown next to the control in Customize Widgets |
kind |
"toggle", "text", "choice" |
yes | The control |
defaultValue |
string | yes | The value until the person changes it |
choices |
array of strings | for choice |
The possible values |
choiceLabels |
array of strings | no | Display names for choices, in the same order |
| Kind | Control | Values |
|---|---|---|
toggle |
switch | "true" / "false" |
text |
text field | any text |
choice |
pop-up menu | one of choices |
All values are strings.
Special keys
Section titled “Special keys”| Key | Effect |
|---|---|
use24Hour |
"false" switches {time}, {hour} and {ampm} to 12-hour time |
showSeconds |
"true" adds seconds to {time} |
text |
shown by {text} (any key works as a token; this one is used by the built-in Custom Text) |
systemMode |
the value "auto" becomes "battery" or "system" depending on whether the Mac has a battery |
Storage
Section titled “Storage”Values are saved per widget id, with its placement. Renaming a key resets it to its default. Removing an option leaves its saved value unused.
See the Options guide for usage.
