Created
August 12, 2014 01:17
-
-
Save nizmow/e62ee4aea45bf615240c to your computer and use it in GitHub Desktop.
AppleScript for toggling Play/Pause in Plex Web
This file contains hidden or 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
tell application "Safari" | |
repeat with theWindow in (get every window) | |
repeat with currTab in theWindow's tabs | |
if name of currTab is equal to "Plex" then | |
do JavaScript "require(['plex/base/utils/Dispatcher'], function(t) { t.trigger('shortcut:playPause') });" in currTab | |
end if | |
end repeat | |
end repeat | |
end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bind this to a service and a global hotkey and you're emulating media keys for a web application. Unfortunately I can't see any way to bind it to the actual play/pause hotkey -- you'd need a real Mac application to take over that.