Skip to main content

Python Desktop Object Type Definitions

Runavelo adds the following types to the Python environment. You can use them without importing a module.

ElementDescriptor

class ElementDescriptor:
def __init__(self, uid, name):
"""
Identifies an element used by commands such as click and input.
:param uid: UID generated when the element is captured
:param name: Element name shown when the element cannot be found
"""
self._uid = uid
self._name = name

@property
def name(self) -> str:
return self._name

@property
def uid(self) -> str:
return self._uid


WindowInstance

class WindowInstance:

@property
def title(self) -> str:
"""
Window title
:return:str
"""
pass

@property
def left(self) -> int:
"""
Horizontal distance in physical pixels from the window's top-left corner to the screen's top-left corner
:return:int
"""
pass

@property
def top(self) -> int:
"""
Vertical distance in physical pixels from the window's top-left corner to the screen's top-left corner
:return:int
"""
pass

@property
def right(self) -> int:
"""
Horizontal distance in physical pixels from the window's bottom-right corner to the screen's top-left corner
:return:int
"""
pass

@property
def bottom(self) -> int:
"""
Vertical distance in physical pixels from the window's bottom-right corner to the screen's top-left corner
:return:int
"""
pass

@property
def width(self) -> int:
"""
Window width (physical pixels)
:return:int
"""
pass

@property
def height(self) -> int:
"""
Window height (physical pixels)
:return:int
"""
pass

@property
def processName(self) -> str:
"""
Current process name
:return:str
"""
pass

WinElement

class WinElement:
@property
def name(self) -> str:
"""
Element name
:return: str
"""
pass

@property
def text(self) -> str:
"""
Element value, such as the text entered in the input box
:return: str
"""
pass

@property
def left(self):
"""
The distance between the left side of the element and the left side of the screen
:return: int
"""
pass

@property
def top(self):
"""
The distance between the top of the element and the top of the screen
:return: int
"""
pass

@property
def right(self):
"""
The distance between the right side of the element and the left side of the screen
:return: int
"""
pass

@property
def bottom(self):
"""
The distance between the bottom of the element and the top of the screen
:return: int
"""
pass

@property
def width(self):
"""
Element width
:return: int
"""
pass

@property
def height(self):
"""
Element height
:return: int
"""
pass

@property
def x_center(self):
"""
The distance between the middle of the element and the left side of the screen
:return: int
"""
pass

@property
def y_center(self):
"""
The distance between the middle of the element and the top of the screen
:return: int
"""
pass

@property
def x_random(self):
"""
The distance of a random position in the element from the left side of the screen
:return: int
"""
pass

@property
def y_random(self):
"""
The distance of a random position in the element from the top of the screen
:return: int
"""
pass

@property
def index(self):
"""
The index of the element within the parent element
:return: int
"""
pass

@property
def parent(self):
"""
Get the parent element
:return: WinElement
"""
pass

@property
def children(self) -> list:
"""
Get all direct child elements
:return: list[WinElement]
"""
pass

@property
def siblings(self):
"""
Get all sibling elements
:return: list[WinElement]
"""
pass


@property
def properties(self) -> dict:
"""
Element attribute collection, key-value pairs
"""
pass