full screen Netflix

Hello,

I am trying to make a script that

  • opens a google chrome (even though safari is default)
  • go to Netflix site (auto login, should do that by default)
  • put it in full screen mode.

Now what I got now works partially

tell application "Google Chrome"
	if it is running then
		quit
	else
		activate
		open location "https://www.netflix.com/browse"
		delay 1
		activate
	end if
end tell

trying to combine it with something like this:

tell application "System Events"
	keystroke "f" using {command down, shift down}
end tell

which is the key combo to go to full screen.
I’ve tried combining them but get errors.
I’ve tried running them back to back but something seems to go wrong in the second script.

hope someone could help me out.
thanks

Hi @spawnreaper ,
This is a pretty simple fix. You need to tell System Events where to send those key commands to, in this case Google Chrome. You do that with a ‘tell process’ command. This should do it for you:


tell application "Google Chrome"
	if it is running then
		quit
	else
		activate
		open location "https://www.netflix.com/browse"
		delay 1
		activate
	end if
end tell
	
tell application "System Events"
	tell process "Google Chrome"
		keystroke "f" using {command down, control down}
	end tell
end tell

NOTE: my default key command to Full Screen in Chrome is Command + Control + F which I put in the code above.