Skip to content

Window ​

The Window module has functionality for dealing primarily with the main window of an application. In contrast the Windows module supports interacting with all the windows on the desktop.

Title ​

Get the title of the main window. Optionally supply a timeout for the operation - default timeout is 500ms normally.

Example ​

javascript
var title = Window.title();
// or with a timeout of 2s
title = Window.title(2000);

Minimize ​

Minimize the main window.

Example ​

javascript
Window.minimize();

Is minimized ​

Check if the main window is minimized.

Example ​

javascript
if(Window.isMinimized()) {
  ... 
}

Maximize ​

Maximize the main window.

Example ​

javascript
Window.maximize();

Is maximized ​

Check if the main window is maximized.

Example ​

javascript
if(Window.isMaximized()) {
  ... 
}

Focus ​

Put focus on the main window.

Parameters ​

  • options optional object with options for focus. Supported options:
    • useCachedUI boolean indicating if UI component lookup should use the UI itself or the underlying model. Defaults to false (underlying model traversal).
    • askForPermission whether or not the user is asked for permission if Manatee is not allowed to focus (default is true)

Example ​

javascript
Window.focus();
// or do not ask for permission (then no focus is done if Manatee cannot focus)
Window.focus({ askForPermission: false });

Send keys ​

Send keyboard events (simulated typing) to a window. Supports special strings for sending special keys.

Parameters ​

  • keys the keys to send - this is a string
  • options optional object with options for sendkeys, supported options:
    • focus [bool] whether to focus the window prior to sending the keys

Example ​

javascript
Window.sendKeys("foo bar");
// or to focus the window prior to sending the keys
Window.sendKeys("foo bar", { focus: true });

Restore ​

Restore the main window to a previous state and location.

Example ​

javascript
Window.restore();

Window with modal dialog shown ​

Get whether or not a modal (dialog) is shown.

Example ​

javascript
var modalIsShown = Window.modalShown();

WARNING

Only java

Shown with title ​

Get whether or not a window with the given title is shown.

Example ​

javascript
var windowIsShown = Window.withTitleShown("My Window");

WARNING

Only java

Dim ​

Dims the window owned by the flow.

Parameters ​

  • level the amount of dimming, 0-255. 255 is opaque and 0 is transparent.

Example ​

javascript
Window.dim(100)