Set Checked State (ui_element.set_checked)
This function is available in versions after 20260507
Declaration
ok, info_or_err = ui_element.set_checked(selector_or_element, checked [, options ])
Parameters
- selector_or_element
Table. A selector, an element returned by a query, or a coordinate table
{ x = X, y = Y }. - checked
Boolean.
truemeans on or selected;falsemeans off or unselected. - options Optional, table. See Common options.
Returns
- ok
Boolean.
trueon success,nilon failure. - info_or_err Table on success, string failure reason on failure.
Description
If the target is already in the requested state, this API returns success. The target control must expose a reliable confirmed state.
Example
local ui_element = require("ui_element")
ui_element.set_checked({
title = "Airplane Mode",
role = "switch",
}, false)