Skip to main content

Get Desktop Element

Command description

Retrieve a specified desktop element and access its coordinates, dimensions, displayed text, and other information. Use Get Related Desktop Elements to retrieve its parent, children, siblings, or descendants.

For example, you can directly use the following Python expression to obtain relevant data:

Python expressionDescription
winElement.nameThe text displayed by the element
winElement.textInput box text
winElement.leftPhysical-pixel distance from the left edge of the screen to the element's left edge; reading it brings the element's window to the front
winElement.topPhysical-pixel distance from the top edge of the screen to the element's top edge; reading it brings the element's window to the front
winElement.rightPhysical-pixel distance from the left edge of the screen to the element's right edge; reading it brings the element's window to the front
winElement.bottomPhysical-pixel distance from the element's bottom edge to the screen's bottom edge; reading it brings the element's window to the front
winElement.widthElement width in physical pixels; reading it brings the element's window to the front
winElement.heightElement height in physical pixels; reading it brings the element's window to the front

For other WinElement properties, see the WinElement class definition.

Command Input Parameters

input parametersInput parameter typeDescription
Desktop ElementstrCaptured desktop element UID, not its name or ms-rpa-id
Element Wait DurationnumberMaximum time to wait for the element to appear, in seconds; an error is raised if the timeout expires

Command Output Parameters

Output parametersOutput parameter typeDescription
Desktop ElementWinElementThe retrieved element. Its coordinate properties use physical screen pixels; reading them brings the element's window to the front.

Type definition reference

tip
  • Capture element reference Capture Desktop Elements
  • Runavelo's type system lets you access relevant information directly from objects without additional commands. This reduces the number of intermediate objects and keeps workflows simpler and clearer.
  • If the required element has not been captured, the AI can call the start_capture_win_element tool.