Get(WindowUUID)
Returns the Universally Unique Identifier (UUID) of the active window.
Format
Get ( WindowUUID )
Parameters
None
Data type returned
text
Originated in version
26.0
Description
Each window is assigned a UUID when it is created. The window's UUID remains the same as long as the window exists. This string of hexadecimal characters identifies the window, even if the window name changes or multiple windows have the same name.
This function returns an empty string if there is no active window.
Notes
-
The window on which the script is acting may not necessarily be the foreground window.
-
Window UUIDs can be used in place of window names in most script steps that let you specify a window, such as Select Window, Close Window, Move/Resize Window, and Set Window Title.
-
Each new window receives a unique UUID, even if the window is created from an existing window using the Window > New Window command or the New Window script step.
Example 1
Returns a value like 38F0E000E91C4214AADCA593F9A810D6 for the active window.
Example 2
Stores the UUID of the active window in a variable, creates a new window (which becomes the active window), then returns to the original window.
Set Variable [ $windowID ; Value: Get ( WindowUUID ) ]
New Window [ Style: Document ; Using layout: <Current Layout> ]
Select Window [ Name: $windowID ]
Example 3
Stores information about the active window as JSON using the window UUID as the key.
Set Variable [ $uuid ; Value: Get ( WindowUUID ) ]
Set Variable [ $$windowData ; Value:
JSONSetElement ( $$windowData ;
[ $uuid & ".lastRecord" ; Get ( RecordNumber ) ; JSONNumber ] ;
[ $uuid & ".windowName" ; Get ( WindowName ) ; JSONString ]
)
]