FindNode Templates & Filters
Templates control which nodes are initially included in the search scope. The default template is TP:more.
Available Templates
| Template | Purpose |
|---|---|
TP:all | All nodes on screen |
TP:more | Most visible nodes (default) |
TP:basic | Common interactive elements |
TP:reduced | Minimal node set |
TP:findText | Text-containing nodes |
TP:anyText | Any node with text property |
TP:textInput | Editable text fields |
TP:line | Linear layout items (e.g., navigation bars) |
TP:appNavBar | App navigation bar items |
TP:scrollable | Scrollable containers |
Template Usage
javascript
// Get all text input fields
device.sendAai({ query: "TP:textInput", action: "getIds" });
// Get navigation bar labels
device.sendAai({ query: "TP:appNavBar,labels", action: "getText" });
// Returns: { count: 5, retval: ['Alarms','World Clock','Timers','Stopwatch','Bedtime'] }
// Get bottom line items
device.sendAai({ query: "TP:line,bottom,-1", action: "getText" });Boolean Property Filters
Use BP: prefix to filter by element state:
| Filter | Meaning |
|---|---|
BP:clickable | Element can be clicked |
BP:editable | Element accepts text input |
BP:checkable | Element is a checkbox/toggle |
BP:checked | Element is currently checked |
BP:selected | Element is selected |
BP:enabled | Element is enabled |
BP:scrollable | Element can scroll |
Combining Filters
javascript
// Clickable buttons with text
device.sendAai({ query: "BP:clickable&&C:Button", action: "getText" });
// Selected navigation item
device.sendAai({ query: "TP:appNavBar&&BP:selected", action: "getText" });
// Editable fields that are enabled
device.sendAai({ query: "BP:editable&&BP:enabled", action: "getIds" });Node Properties
Each node has these searchable properties:
| Property | Description |
|---|---|
| ID | Unique identifier on current screen |
| Package Name | App package (e.g., com.sigma_rt.sigmatestapp) |
| Class Name | UI class (e.g., .Button, .EditText) |
| Resource ID | Layout resource ID |
| Bounds | Screen position [left,top][right,bottom] |
| Text | Displayed text content |
| Boolean Properties | clickable, enabled, checkable, checked, etc. |
Limitations
- Portrait mode only — limited landscape support
- Limited horizontal scrolling — vertical scrolling works best
- No multi-threading — sequential query execution
- Incomplete WebView support — some apps like Facebook and YouTube have custom rendering