Skip to content

Instantly share code, notes, and snippets.

@henrik
Created November 21, 2009 23:28
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save henrik/240336 to your computer and use it in GitHub Desktop.
Save henrik/240336 to your computer and use it in GitHub Desktop.
Start Plex if not running. Make fullscreen if running windowed. Quit if running fullscreen.
-- Start Plex if not running. Make fullscreen if running windowed. Quit if running fullscreen.
-- By Henrik Nyh <http://henrik.nyh.se> 2009-11-22 under the MIT License.
-- Some code from http://forums.plexapp.com/index.php?/topic/8325-applescript-focusfullscreen-plex/
tell application "Plex"
-- "if it is running" is probably Snow Leopard only.
if it is running then
tell application "System Events" to tell process "Plex"
set isFullscreen to position of window 1 is {0, 0}
end tell
if isFullscreen then
quit
return
end if
end if
activate
tell application "System Events" to tell process "Plex"
set frontmost to true
tell menu "View" of menu bar 1 to click menu item "Enter Full Screen"
end tell
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment