Skip to main content
Version: 8.1

system.gui.desktop

This function is used in Python Scripting.

Description​

Allows for invoking system.gui functions on a specific desktop.

See the Multi-Monitor Clients page for more details.

Client Permission Restrictions​

This scripting function has no Client Permission restrictions.

Syntax​

system.gui.desktop(handle)

Parameters​

TypeParameterDescription
StringhandleThe handle for the desktop to use. The screen index cast as a string may be used instead of the handle. If omitted, this will default to the primary desktop. Alternatively, the handle "primary" can be used to refer to the primary desktop.

Returns​

WindowUtilities - A copy of system.gui (WindowUtilities) that will be relative to the desktop named by the given handle.

Scope​

Vision Client

Code Examples​

Example #1 - Opening Message Box in a Different Desktop
# The following example makes a message box appear on the primary desktop,
# regardless of where the script originates.
# system.gui.desktop() function requires a handle be passed to it for this example
# to work properly.

system.gui.desktop().messageBox("This will appear on the Primary Desktop")
Example #2 - Showing Open Windows in a Specific Desktop
# Retrieves a list of open windows in a specific Desktop. This example assumes a desktop with the handle "2nd Desktop" exists.
name = "2nd Desktop"
# Returns a tuple of open windows in the Desktop named "2nd Desktop".
windows = system.gui.desktop(name).getOpenedWindows()

# Converts the tuple to a string, and shows the items in a message box.
system.gui.messageBox(str(windows))

Keywords​

system gui desktop, gui.desktop