Keyboard Maestro “FullScreen check” Macro

Keyboard Maestro “FullScreen check” Macro

In Safari I normally have a Macro Palette open, but if Safari is in fullscreen mode ( when viewing videos on YouTube, etc.) I don't want to see the Palette. This macro shows or hides the Palette when Safari switches to and from fullscreen.

FullScreen check.kmmacros (3.5 KB)

2 Likes

Or, in OS X 10.10+ JavaScript for Applications, you could, FWIW, write:

Application("System Events").processes["Safari"]
.windows[0].attributes['AXFullScreen'].value()

and if there were any risk of an error condition (Safari not running, or running but no windows open, for example), you could write something slightly more defensive:

(function () {
    var lstProcs = Application("System Events").processes.where({
            name: "Safari"
        }),
        lstWins = lstProcs.length ? lstProcs[0].windows() : [];

    return lstWins.length ? lstWins[0].attributes['AXFullScreen'].value() : null;
})();
1 Like