Last active
August 29, 2015 14:12
-
-
Save jdaily/1c7e86c4b1e7875ff876 to your computer and use it in GitHub Desktop.
Google Play dotremote Apple Script
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
# 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