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.
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β
| Type | Parameter | Description |
|---|---|---|
| String | name | The 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.vision.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")