Created
November 21, 2009 23:28
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- 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