Tutorial: system.getFocusedWindow

system.getFocusedWindow

Retrieves currently focused window.

Example

fin.desktop.System.getFocusedWindow(function (focusedWindow) {
    if (focusedWindow) {
        console.log("application UUID of focused window: ", focusedWindow.uuid);
        console.log("window name of focused window: ", focusedWindow.name);
    }
});

Focused Window

//This response has the following shape:
{
    uuid: "uuid", //uuid of the application,
    name: "windowName" //name of the window,
}