editor.slate

Slate UI widget inspection and interaction

← API Reference

editor.slate.getWidgetTree

Returns the Slate widget tree for all top-level windows.

Parameters:

Name Type Required Description
max_depthintNoMaximum traversal depth (1–10, default 3)

Returns:

Name Type Description
windowsarrayWidget tree per window (type, visibility, enabled, geometry, children)
window_countnumberNumber of top-level windows
max_depthnumberDepth used for traversal

Example Request:

{ "jsonrpc": "2.0", "id": 1, "method": "editor.slate.getWidgetTree", "params": { "max_depth": 2 } }

editor.slate.getWidgetState

Searches for widgets matching a type name and returns their state.

Parameters:

Name Type Required Description
widget_typestringYesWidget type substring to match (e.g. "SButton")
max_resultsintNoMaximum matches to return (1–100, default 10)

Returns:

Name Type Description
widget_typestringThe searched type
matchesarrayMatching widgets (each with type, visibility, enabled, geometry)
match_countnumberNumber of matches found

Example Request:

{ "jsonrpc": "2.0", "id": 1, "method": "editor.slate.getWidgetState", "params": { "widget_type": "SButton", "max_results": 5 } }

editor.slate.clickWidget

Finds a button widget by type and optional text, then simulates a click.

Parameters:

Name Type Required Description
widget_typestringYesWidget type substring to match
textstringNoText substring the widget must contain
indexintNo0-based index among matches (default 0)

Returns:

Name Type Description
clickedboolWhether the click succeeded
widget_typestringActual type of the clicked widget
textstringText extracted from the widget (if any)

Example Request:

{ "jsonrpc": "2.0", "id": 1, "method": "editor.slate.clickWidget", "params": { "widget_type": "SButton", "text": "Compile" } }

editor.slate.findWidgets

Advanced widget search with flexible criteria. Supports matching by type, text, or both. Returns richer data including text content, simplified widget path, and position/size.

Parameters:

Name Type Required Description
typestringNo*Widget type substring to match (e.g. "SButton", "SCheckBox")
textstringNo*Text substring to match (case-insensitive)
visible_onlyboolNoOnly return visible widgets (default true)
max_resultsintNoMaximum matches to return (1–100, default 20)
max_depthintNoMaximum traversal depth (1–50, default 10)

*At least one of type or text must be provided.

Returns:

Name Type Description
matchesarrayMatching widgets (type, text, visibility, enabled, size, position, widget_path)
match_countnumberNumber of matches found
type_filterstringThe type filter used (if provided)
text_filterstringThe text filter used (if provided)

Example Request:

{ "jsonrpc": "2.0", "id": 1, "method": "editor.slate.findWidgets", "params": { "type": "SButton", "max_results": 5 } }

editor.slate.getPropertyPanel

Reads the Details panel for the current selection. Returns all editable properties organized by category.

Parameters:

Name Type Required Description
categorystringNoFilter to categories containing this substring (case-insensitive)

Returns:

Name Type Description
selected_objectstringClass name of the selected object
categoriesarrayProperty categories, each with name and properties array (name, type, value, is_editable)

Example Request:

{ "jsonrpc": "2.0", "id": 1, "method": "editor.slate.getPropertyPanel" }

editor.slate.getEditorContext

Returns rich context about the current editor state — active editor, mode, tool, foreground tab, window title, language, and locale.

No parameters.

Returns:

Name Type Description
active_editorstringName of the most recently activated editor
editor_modestringCurrent editor mode ("Default", "Placement", "Landscape", etc.)
active_toolstringCurrently active interactive tool name, or "None"
foreground_tabstringLabel of the foreground dock tab
window_titlestringTitle of the active top-level window
languagestringCurrent editor language (e.g. "en")
localestringCurrent editor locale (e.g. "en")

Example Request:

{ "jsonrpc": "2.0", "id": 1, "method": "editor.slate.getEditorContext" }

editor.slate.getMenuItems

Enumerates items in a menu or toolbar. When called with no parameters, returns the list of top-level menus. When given a menu_name, returns entries in that menu.

Parameters:

Name Type Required Description
menu_namestringNoMenu to enumerate. Shorthand supported: "File", "Edit", "Window", "Tools", "Build", "Help". Full ToolMenu names also accepted.
toolbarboolNoIf true, resolve shorthand against toolbar namespace (default false)

Returns:

Name Type Description
itemsarrayMenu/toolbar entries (label, tooltip, command_name, is_submenu, is_enabled, is_checked, section)
item_countnumberNumber of entries returned
menustringFull ToolMenu name that was enumerated

Example Request:

{ "jsonrpc": "2.0", "id": 1, "method": "editor.slate.getMenuItems", "params": { "menu_name": "File" } }

editor.slate.invokeMenuItem

Triggers a menu action by matching label text or internal command name.

Parameters:

Name Type Required Description
labelstringNo*Text substring to match against menu item labels (case-insensitive)
commandstringNo*Exact internal command/entry name to match
menu_namestringNoRestrict search to a specific menu

*At least one of label or command must be provided.

Returns:

Name Type Description
successboolWhether the action was executed
labelstringLabel of the executed menu item

Example Request:

{ "jsonrpc": "2.0", "id": 1, "method": "editor.slate.invokeMenuItem", "params": { "label": "Save Current Level" } }

editor.slate.getTabs

Lists all open dock tabs across all tab wells and windows.

No parameters.

Returns:

Name Type Description
tabsarrayAll open dock tabs (label, role, is_foreground, tab_id)
tab_countnumberTotal number of open tabs

Example Request:

{ "jsonrpc": "2.0", "id": 1, "method": "editor.slate.getTabs" }

editor.slate.activateTab

Brings a dock tab to the foreground in its tab well.

Parameters:

Name Type Required Description
labelstringNo*Text substring to match against tab labels (case-insensitive)
tab_idstringNo*Exact tab layout identifier (from getTabs response)

*At least one of label or tab_id must be provided.

Returns:

Name Type Description
successboolWhether the tab was activated
labelstringLabel of the activated tab

Example Request:

{ "jsonrpc": "2.0", "id": 1, "method": "editor.slate.activateTab", "params": { "label": "Content Browser" } }

editor.slate.getDialogs

Lists active modal dialog windows. Returns each dialog's title, type, button labels, and message text. Useful for detecting unexpected dialogs that block editor workflows.

No parameters.

Returns:

Name Type Description
dialogsarrayActive modal dialog windows (title, type, is_modal, buttons, message)
dialog_countnumberNumber of active dialogs

Example Request:

{ "jsonrpc": "2.0", "id": 1, "method": "editor.slate.getDialogs" }

editor.slate.dismissDialog

Clicks a button on the frontmost modal dialog to dismiss it.

Parameters:

Name Type Required Description
buttonstringYesButton label substring to match (case-insensitive)

Returns:

Name Type Description
successboolWhether the button was clicked
dialog_titlestringTitle of the dismissed dialog
button_clickedstringActual text of the clicked button

Example Request:

{ "jsonrpc": "2.0", "id": 1, "method": "editor.slate.dismissDialog", "params": { "button": "Save Selected" } }