Window management object than can be used to represent a window on the desktop.
Constructor function.
var myObject = new Window();
var myObject = new Window(otherWindow);
Create an invalid Window.
var myObject = new Window();
Create a Window representing a copy of otherWindow.
var myObject = new Window(otherWindow);
Returns an array of Window representing all the windows on the desktop.
Window.all();
This example will print all the windows titles in the console.
var windows = Window.all(); for(var i = 0; i < windows.length; ++i) Console.print(windows[i].title() + "\n");
Searches for windows matching some criteria. Any omitted criteria is not used. Only windows matching all criteria are returned.
Window.find(parameters);
Find the window called "Notepad".
var windows = Window.find({ title: "Notepad" });
Find the windows whose title starts with "Notepad", using wildcards.
var windows = Window.find({ title: "Notepad*", titleMode: Window.Wildcard });
You can use the following code to show the title of all found windows :
for(var i = 0; i < windows.length; ++i) Console.print(windows[i].title() + "\n");
Returns a copy of this Window.
myObject.clone();
var copyOfMyObject = myObject.clone();
Returns true if this Window and another are referencing the same window.
myObject.equals(other);
if(myFirstObject.equals(mySecondObject)) //Do something
Returns a string representing this Window.
myObject.toString();
Console.print(myObject.toString());
This method is automatically called when trying to convert a Window to a string.
Returns true if this Window is referencing a window, false otherwise.
myObject.isValid();
if(myObject.isValid()) //Do something
Returns the title of the current window.
myObject.title();
Console.print(myObject.title());
Returns the class name of the current window.
myObject.className();
Console.print(myObject.className());
Returns true if this Window is the foreground Window, false otherwise.
myObject.isActive();
Returns a Rect representing the rectangle of the window.
myObject.rect();
myObject.rect(useBorders);
- useBorders - (bool) use window borders when resizing the window (default: true) [Added in Actionaz 3.2.0.]
Returns a ProcessHandle representing the process owning the window.
myObject.process();
Close this window.
myObject.close();
Kill the process owning this window.
myObject.killCreator();
Set this window to the foreground.
myObject.setForeground();
Minimize the window.
myObject.minimize();
Maximize the window.
myObject.maximize();
Move the window.
myObject.move(point);
Resize the window.
myObject.resize(size);
myObject.resize(size, useBorders);
Match modes for the find function.
Find the windows whose title starts with "Notepad", using wildcards.
var windows = Window.find({ title: "Notepad*", titleMode: Window.Wildcard });