ui.ui.find_all
Declaration
lua
ui.find_all(query)
Description
Liệt kê các phần tử đang hiển thị khớp query.
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
`array` (rỗng khi không thấy); lỗi: `nil, error`.
Example
lua
local buttons, err = ui.find_all({type="button"})
if buttons then
for i, el in ipairs(buttons) do sys.log(i .. ": " .. el.label) end
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.