Tutorial: application.getGroups

application.getGroups

Retrieves an array of active window groups for all of the application's windows. Each group is represented as an array of wrapped fin.desktop.Windows.

Example

// Assumes we have 5 windows (wndA, wndB, wndC, wndD and wndE)
// Group wndA, wndB and wndC
wndA.joinGroup(wndC);
wndB.joinGroup(wndC);

// Group wndD and wndE
wndD.joinGroup(wndE);

var application = fin.desktop.Application.getCurrent();

application.getGroups(function (allGroups) {
    console.log("There are a total of " + allGroups.length + " groups.");

    var groupCounter = 1;
    allGroups.forEach(function (windowGroup) {
        console.log("Group " + groupCounter + " contains " +
                    windowGroup.length + " windows.");
        ++groupCounter;
    });
});