How To Call It#
This is an object method: call it with a colon on a Region object created with Region(x, y, w, h), or Region() for the whole screen (region:<method>(...)). The global Region table does not have this method. Requires Macro Handler 1.0.62 or later.
When To Use It#
In detection flow, refresh the screen with Snap.screenRefresh() first, then narrow the search area and confidence using Region and FindParam.
Parameters and Return#
kind: text or button. unit: word, line, paragraph. buttonSource: auto, android, visual. Defaults to text, line and auto. An empty result returns {}.
Options and Limits#
Filter by color (#RRGGBB), tolerance (0–255, default 24), minLength/maxLength, minWidth/maxWidth and minHeight/maxHeight. A maximum of 0 is unlimited. Pass a Region or {excludeRegions={r1,r2}} as excludeRegion. selection accepts first, random or all (default). mark=true outlines all eligible results before selection.
Best Combined With#
profile defaults to auto. Text profiles are quick_text, balanced_text, precision_text, tiny_text, low_contrast_text, scene_text, rotated_text, styled_text, chinese_text, japanese_text, korean_text, devanagari_text, arabic_text and cyrillic_text. Use script to select the OCR writing system. Drawn button profiles are button_fast, button_balanced and button_precise. To scan inside a match, call hit:getRegion():detectUi(options).