Google Chrome - Play Music Service Shortcuts

Joined
Jun 13, 2012
Messages
1
Reaction score
0
I have a strange problem I can't figure out. I've created a service in Automator to control Google Play Music within a Chrome window when it is currently playing a song. I have play/pause controls listed in the following Service code:

Code:
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
			try
				if (title of currTab) contains "My Music - Google Play" then set musicTab to currTab
			end try
		end repeat
		tell musicTab to execute javascript "SJBpost('nextSong');"
	end tell
end run

The strange thing is, this service works fine from within Automator (clicking on Run results in the intended function taking place in the browser, regardless of the fact that the browser is not in focus.) However, when I map it to a keyboard shortcut, or if I select it from the Menu bar ("Chrome" --> "Services" --> "Google Play PlayPause"), the service has no effect.

I can't seem to figure out why I cannot get the service to work outside of Automator itself. Can anyone help?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top