0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

[AppleScript] Chrome Full Screen Mode

Last updated at Posted at 2021-08-14
on run argv	
	set theapp to "Google Chrome"

	if application theapp is running then
		return
	end if
	
	if item 2 of argv is "false" then
		set toggleOnFull to true
	else
		set toggleOnFull to false
	end if
	
	tell application theapp
		activate
		delay 2
		(* 
      Initially from http://stackoverflow.com/questions/8215501/applescript-use-lion-fullscreen
    *)
		set isFullScreen to false
		tell application "System Events" to tell process theapp
			set isFullScreen to value of attribute "AXFullScreen" of window 1
		end tell
		--display dialog "var " & isfullscreen
		
		if isFullScreen is toggleOnFull then
			tell application "System Events" to keystroke "f" using {command down, control down}
			delay 2
		end if
	end tell
end run

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?