0
votes

I'm working with a kiosk (touch screen) and I want the script to sense if Chrome isn't running. And if it isn't running - Start Chrome in fullscreen mode.

The sample below works, except that if I quit Chrome it will start in full screen and the applescript will destroy the full screen mode.

Can AppleScript sense if Google Chrome is in fullscreen mode?

Like: if application "Google Chrome" is in fullscreen mode then ...

if application "Google Chrome" is not running then
    tell application "Google Chrome"
        activate
        tell application "System Events"
            delay 2
            keystroke "f" using {shift down, command down}
        end tell
    end tell
end if

Thanks!

1

1 Answers

3
votes

One hack is to check if the number of windows returned by System Events and the application are the same:

tell application "System Events" to number of windows of process "Google Chrome"
tell application "Google Chrome" to number of windows is not result

System Events does not include full screen windows but applications do.