Skip to content

Instantly share code, notes, and snippets.

@jdaily
Last active August 29, 2015 14:12
Show Gist options
  • Save jdaily/1c7e86c4b1e7875ff876 to your computer and use it in GitHub Desktop.
Save jdaily/1c7e86c4b1e7875ff876 to your computer and use it in GitHub Desktop.
Google Play dotremote Apple Script
# Basic Play Options
## Play/Pause/Previous/Next
tell application "Google Chrome"
repeat with w in (every window)
repeat with t in (every tab whose URL contains "play.google.com/music") of w
# Options for action are:
# 1 = previous
# 2 = play/pause
# 3 = next
set action to 2
tell t to execute javascript "document.getElementsByClassName('flat-button')[" & action & "].click();"
return
end repeat
end repeat
end tell
# Advanced Options
## Like
tell application "Google Chrome"
repeat with w in (every window)
repeat with t in (every tab whose URL contains "play.google.com/music") of w
tell t to execute javascript "document.getElementsByClassName('rating-container thumbs')[0].getElementsByTagName('li')[0].click();"
return
end repeat
end repeat
end tell
## DisLike
tell application "Google Chrome"
repeat with w in (every window)
repeat with t in (every tab whose URL contains "play.google.com/music") of w
tell t to execute javascript "document.getElementsByClassName('rating-container thumbs')[0].getElementsByTagName('li')[1].click();"
return
end repeat
end repeat
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment