How To Call It
Ui is a singleton global table: call its functions with a dot (Ui.<method>(...)).
Reads the on-screen app interface from the accessibility tree: finds elements by text or id and clicks them.
Documented for app version 1.0.51Updated:
Ui is a singleton global table: call its functions with a dot (Ui.<method>(...)).
In automation flow, chain actions with short wait() intervals and use requestStop() or controlled retry on failure paths.
Ui offers 6 methods; each method page lists its parameters and return value.
Rate limit: Ui calls are limited to 60 per second; past the limit the call raises an error.
It works best together with wait(), Point, SwipeParam, ClickParam, and sometimes a Region result.
The snippet below is a starter pattern that can be applied directly in runtime flow.
local node = Ui.byText("Settings")
if node then Ui.click(node) endFrom foundation to combined usage, each level is provided as a separate code block so you can copy the level you need and adapt it directly.
local node = Ui.byText("Settings")
if node then Ui.click(node) endlocal node = Ui.byText("Settings")
if node then Ui.click(node) end
-- Continue with one focused method on the object.local node = Ui.byText("Settings")
if node then Ui.click(node) end
local note = "Ui overview loaded"
print(note)-- In automation flow, chain actions with short wait() intervals and use requestStop() or controlled retry on failure paths.
local function run_ui_step()
local node = Ui.byText("Settings")
if node then Ui.click(node) end
end
local ok, err = pcall(run_ui_step)
if not ok then
toast("Step failed")
print(err)
endlocal target = Point(540, 960)
quickTap(target)
wait(250)
local node = Ui.byText("Settings")
if node then Ui.click(node) end
wait(250)
print("Automation chain completed")