Skip to main content
Version: 8.3 Beta 🚧

system.vision.getWindow

Backwards Compatibility

This function replaces system.gui.getWindow. Any scripts containing Vision Client scoped functions that were replaced with system.vision syntax will still work to maintain backwards compatibility. Only the system.vision variations will appear in the Script Editor's autocomplete popup.

This function is used in Python Scripting.

Description​

Finds a reference to an open window with the given name. Throws a ValueError if the named window is not open or not found.

note

This function is available on secondary desktops via the system.vision.desktop function. See the Multi-Monitor Clients page for more details on secondary desktops.

Client Permission Restrictions​

This scripting function has no Client Permission restrictions.

Syntax​

system.vision.getWindow(name)

Parameters​

TypeParameterDescription
StringnameThe path to the window to field.

Returns​

Window - A reference to the window object, if it was open.

Scope​

Vision Client

Code Examples​

Example #1
# This example will get the window named 'Overview' and then close it.

try:
window = system.vision.getWindow('Overview')
system.nav.closeWindow(window)

except ValueError:
system.vision.showWarning("The Overview window isn't open")
Example #2
# This example will set a value on a label component in the 'Header' window.

try:
window = system.vision.getWindow('Header')
window.getRootContainer().getComponent('Label').text = "Machine 1 Starting"

except ValueError:
system.vision.showWarning("The Header window isn't open")