Skip to content

Instantly share code, notes, and snippets.

@jelder
Created December 9, 2011 22:24
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save jelder/1453585 to your computer and use it in GitHub Desktop.
Save jelder/1453585 to your computer and use it in GitHub Desktop.
AppleScript to launch Chrome in Presentation mode (Fullscreen)
# url.txt should contain the URL load in Chrome in full screen.
do shell script "open '/Applications/Google Chrome.app' " & readFile("/url.txt")
tell application "Google Chrome" to activate
tell application "System Events"
keystroke "f" using {command down, shift down}
end tell
# All this just to read a file; no backticks in AppleScript.
on readFile(unixPath)
set foo to (open for access (POSIX file unixPath))
set txt to (read foo for (get eof foo) as Çclass utf8È)
close access foo
return txt
end readFile
@jelder
Copy link
Author

jelder commented Mar 2, 2012

On line 12, "class utf8" should be enclosed in Guillemets, which ironically are not represented in UTF-8 in the AppleScript Editor.

@lorddev
Copy link

lorddev commented May 29, 2013

They seem to have made this the default behavior.

@75lb
Copy link

75lb commented Feb 4, 2014

nice one, thanks.. i just took this bit:

tell application "Google Chrome Canary" to activate
tell application "System Events"
    keystroke "f" using {command down, shift down}
end tell

@iPadGuy
Copy link

iPadGuy commented Aug 3, 2015

It seems that Presentation Mode has been removed from Chrome...

@rvanbaalen
Copy link

@iPadGuy nope. Still here. CMD+SHIFT+F on Mac.

@bmaddy
Copy link

bmaddy commented Mar 16, 2016

Yep, presentation mode has been removed on their latest update. I suspect @iPadGuy was using chromium and saw it earlier. It appears you need to make sure "Hide Toolbar in Full Screen" is checked and then go fullscreen with

keystroke "f" using {control down, command down}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment