Request an invite
Docs menu

osmates vm elements

Print the controls of a Windows, macOS or Linux desktop machine, each with its ref and box in display pixels.

Usage
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>Required

The 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.

--offscreen

Also 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

--json

Print machine-readable JSON.

JSON output

With --json, it prints an object with these fields.

JSON Schema: /schemas/0/cli/vm/elements.json

changesobject
changes.displayHeightintegerRequired
changes.displayWidthintegerRequired
changes.elapsedintegerRequired
changes.entriesarray of objectsRequired
changes.listedintegerRequired
changes.removedarray of objectsRequired
changes.scopestringRequired

One of focused, screen, element.

changes.sincestringRequired
changes.sinceTruncationstring

One of depth, elements, time, size.

changes.truncationstring

One of depth, elements, time, size.

changes.unchangedintegerRequired
changes.walkedintegerRequired
idstringRequired
modestringRequired

One of full, interactive, skeleton.

treeobject
tree.displayHeightintegerRequired
tree.displayWidthintegerRequired
tree.elapsedintegerRequired
tree.elementsarray of objectsRequired
tree.listedintegerRequired
tree.scopestringRequired

One of focused, screen, element.

tree.truncationstring

One of depth, elements, time, size.

tree.walkedintegerRequired

Fields nested deeper are in the schema.

Exit statuses

Its exit status is one of these.

StatusMeaning
0The command did what it was asked.
1The command failed; with --json, standard error's last line is the error object.
64The command line is wrong, as ArgumentParser found before the command ran.
65What was given is wrong, found while the command ran; the same command fails until it changes.
75The same command can work later with nothing changed, as while an update finishes.
130Control-C cancelled what the command started.

Report a problem with this page