Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Click here to return to the '10.6: Create global hotkeys to control Google Music playback' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.6: Create global hotkeys to control Google Music playback
Authored by: adlr on Jun 24, '11 04:45:52PM

Here's one that seems to work for Grooveshark:

on run
tell application "Google Chrome"
set allWins to every window
set allTabs to {}
repeat with currWin in allWins
set allTabs to allTabs & every tab of currWin
end repeat
repeat with currTab in allTabs
if ((characters -10 thru -1 of (title of currTab as string)) as string) = "rooveshark" then set musicTab to currTab
end try
end repeat
tell musicTab to execute javascript "if(GS.player.isPaused) { GS.player.resumeSong(); } else if(GS.player.isPlaying) { GS.player.pauseSong(); } else { GS.player.playSong(); }"
end tell
end run

[ Reply to This | # ]