Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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