ui Added 1.1.249

ui.ui.find

Declaration
lua
ui.find(query)
Description
Tìm phần tử Accessibility đang hiển thị đầu tiên.
Parameters
`query`: chuỗi nhãn hoặc {label, identifier, type, contains, bundle_id, index}. Nhãn mặc định khớp chính xác; index bắt đầu từ 1.
Return Values
`table` phần tử; lỗi/không thấy: `nil, error`. Tọa độ x/y/w/h/cx/cy là pixel.
Example
lua
local el, err = ui.find({label="Search Facebook", type="button"})
if el then sys.log(el.label) else sys.log(err) end
Notes
Đọc Accessibility, tùy app/màn hình. Cache 150 ms; tối đa 128 phần tử, ngân sách đọc 700 ms. Chặn Quick Launch/hộp thoại, khóa và sai app clone. Không bật VoiceOver; phiên được khôi phục khi script/eval kết thúc.