osmates vm elements
Print the controls of a Windows, macOS or Linux desktop machine, each with its ref and box in display pixels.
osmates vm elements [<options>] <machine>Each line is an element, indented by depth: its role, name, value, ref, box [x0, y0, x1, y1], states and actions. Refs are new at every read; act on them with osmates vm act. --mode interactive lists what takes an action, --mode skeleton 3 levels with each element's count of children, whose refs read further with --ref, and --since a read id lists only what changed since that read: + added, ~ changed, - removed. The guest's text is printed with its control characters escaped. Windows reads them through UI Automation, macOS through AX once a person at the machine allows OSMates Agent in its Privacy & Security settings, which clones of the machine keep, and a Linux desktop through AT-SPI, without boxes on Wayland.
Arguments
<machine>RequiredThe machine's identifier or name.
--scope <scope>focused for the window with the focus and its menus and popups, or screen for every window. Default: focused.
One of
focused,screen.--ref <ref>Read the subtree of this ref instead.
--depth <depth>Levels to read, 1 to 100. Default: 30, or 3 with --mode skeleton, which reads 99 at most.
--elements <elements>Elements to read at most, also those not listed, 1 to 2000. Default: 500.
--offscreenAlso list elements scrolled or collapsed out of view.
--mode <mode>full, interactive or skeleton. Default: full. interactive reads windows, the focused element and those that take an action other than focus and scroll-into-view. skeleton reads the first levels, each element with its count of children.
One of
full,interactive,skeleton.--since <since>A read id: list only what was added, removed or changed since that read, read again with its scope, mode and limits.
--timeout <timeout>Seconds the guest may take, 1 to 20.
Default:
5--jsonPrint machine-readable JSON.
JSON output
With --json, it prints an object with these fields.
JSON Schema: /schemas/0/cli/vm/elements.json
changesobjectchanges.displayHeightintegerRequiredchanges.displayWidthintegerRequiredchanges.elapsedintegerRequiredchanges.entriesarray of objectsRequiredchanges.listedintegerRequiredchanges.removedarray of objectsRequiredchanges.scopestringRequiredOne of
focused,screen,element.changes.sincestringRequiredchanges.sinceTruncationstringOne of
depth,elements,time,size.changes.truncationstringOne of
depth,elements,time,size.changes.unchangedintegerRequiredchanges.walkedintegerRequiredidstringRequiredmodestringRequiredOne of
full,interactive,skeleton.treeobjecttree.displayHeightintegerRequiredtree.displayWidthintegerRequiredtree.elapsedintegerRequiredtree.elementsarray of objectsRequiredtree.listedintegerRequiredtree.scopestringRequiredOne of
focused,screen,element.tree.truncationstringOne of
depth,elements,time,size.tree.walkedintegerRequired
Fields nested deeper are in the schema.
Exit statuses
Its exit status is one of these.
| Status | Meaning |
|---|---|
| 0 | The command did what it was asked. |
| 1 | The command failed; with --json, standard error's last line is the error object. |
| 64 | The command line is wrong, as ArgumentParser found before the command ran. |
| 65 | What was given is wrong, found while the command ran; the same command fails until it changes. |
| 75 | The same command can work later with nothing changed, as while an update finishes. |
| 130 | Control-C cancelled what the command started. |