Beta software, written entirely by AI.Nothing has been reviewed line by line by a human or security-audited. No warranty, no liability: you use it at your own risk.Read more
Skip to content

Settings pages ​

A plugin can add a settings form to the Plugins window. The editor draws the form from a list of field declarations; the plugin never draws UI itself. The same fields (plain objects) also describe the form of an action.

A plugin with a settings page gets a gear button in the Plugins window, and its status bar item opens the page.

Declaring a page ​

host.settings.page(fields) adds a page. The values are stored in settings.json in the plugin folder, at most 64 KB (a larger save is refused with a message), and read with host.settings.get(). Register the page at the top level of the script.

js
host.settings.page([
  { key: 'step', label: 'Step', kind: 'Number', default: 1, min: 1, max: 100 },
]);

Field kinds and options ​

kind is Text, Password, Number, Slider, Bool, Select, Segmented, File, List, Button or Notice. File is a path box with a Browse button, List is a set of repeated rows, Button runs a command in the plugin (official C# plugins only), and Notice is read-only warning text (Button and Notice are never saved as values). Useful field options:

OptionMeaning
Description, Placeholder, DefaultHelp text, a hint and the initial value.
Min, Max, StepLimits for Number and Slider.
OptionsA fixed SettingOption[] for Select and Segmented.
OptionsSourceThe id of a dynamic list served by IOptionsSource.
DependsOnKeys whose current form values are passed to GetOptionsAsync; a change refetches the list.
AllowVariablesShows the {var} insert button on a text field. You receive the raw template.
VisibleWhenOnly show the field when another field equals a value, for example "mode=pause". Inside a List row it is checked against that row's own values.
FileFilterRequired for File: a WinForms file filter such as "Audio files (*.wav;*.mp3)|*.wav;*.mp3", passed to the native file picker as is.
ItemFieldsRequired for List: the fields of one row. The value is a JSON array of objects; keys outside the schema are kept across a save.
CommandRequired for Button: the command id passed to ISettingsCommandHandler.RunCommandAsync(command, values, token) on the same class as your settings page. The returned text is shown as a short message.

Only in official C# plugins ​

Some things need code inside the server and are therefore not available to JavaScript plugins: a Button field that runs a command in the plugin, dropdowns filled from a live source (OptionsSource), and protected secrets (a Password field is hidden while typing, but a JavaScript plugin stores its value as plain text in settings.json, so say so in your README).

Macro Grid sites: PC · Phone · Plugins
Released under the MIT License. Beta software, written entirely by an AI assistant, provided as is without warranty.