--- title: "system.gui.desktop" description: "Allows for invoking system.gui functions on a specific desktop." --- # system.gui.desktop > Allows for invoking system.gui functions on a specific desktop. This function is used in **Python Scripting**. ## Description See the [Multi-Monitor Clients](clients\multi-monitor-clients.md) page for more details. ## Client Permission Restrictions This scripting function has no [Client Permission](projects\project-properties\project-properties.md#client---permissions) restrictions. ## Syntax `system.gui.desktop(handle)` ### Parameters |Type|Parameter|Description| |--|--|--| |String |`handle` | The 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 that will be relative to the desktop named by the given handle. ### Scope Client ## Code Examples ```python title="Example #1" # The following example will make a message box appear on the Primary Desktop, # regardless of where the script originates from. system.gui.desktop().messageBox("This will appear on the Primary Desktop") ``` ```python title="Example #2" # 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)) ```