What it does
A script's ScriptUI opens as a Brio panel you can dock. The script's top-level this is a Panel (as for a script in AE's ScriptUI Panels folder), so the usual pattern docks:
var w = (this instanceof Panel) ? this : new Window("palette", "Title");
var b = w.add("button", undefined, "Add Null");
b.onClick = function () { app.project.activeItem.layers.addNull(); };
if (w instanceof Window) w.show();
A new Window("palette") that is show()n opens as a panel too.
- Each button click or edit runs its handler as one run, on the comp open at that moment, as one undo step.
- The panel stays until it's closed — by its tab, or
win.close(). Closing the tab ends the script.
Building
container.add(type, bounds, text, properties).- Resource strings:
w.add("group { orientation: 'row', ok: Button { text: 'OK' } }"),new Window("palette { … }"). Named children become properties (w.grp.ok).
Containers and layout
| Item | Notes |
|---|---|
group, panel, tabbedpanel / tab | Containers. |
orientation | row / column / stack |
alignChildren, alignment, spacing, margins | |
preferredSize (or size / bounds) | Sets the size. Pixel positions in bounds are ignored. |
characters | On text fields. |
Controls
| Control | Notes |
|---|---|
statictext | |
edittext | multiline, readonly, noecho |
button | |
iconbutton | Shows its text. |
checkbox | |
radiobutton | Siblings are exclusive. |
slider / scrollbar | value, minvalue, maxvalue |
dropdownlist / listbox | items, add("item", text), selection, removeAll(), find(text); listbox multiselect |
progressbar |
Common members: text, value, enabled, visible, helpTip, name, properties, parent, children, remove(), removeAll(), layout.layout() (no-op), show(), hide(), close(), center().
Events
| Event | When |
|---|---|
onClick | Clicked. |
onChange | Field left or Enter pressed, slider released, list item picked. |
onChanging | As you type or drag. |
onDoubleClick | Listbox. |
onShow, onClose |
Also addEventListener("click", fn) and notify().
Dialogs
new Window("dialog") + show() returns 1 (OK) or 2 (Cancel), as in AE. A button named or labelled ok / cancel closes it without a handler; close(n) returns n.
Brio shows the dialog and then runs the script again from the top with the answers filled in, so code before show() runs twice — keep it free of side effects.
Limits
imageandgraphics(custom drawing, fonts, colours) are accepted and ignored.ScriptUI.environment.keyboardStatereads all keys up.