Like song in Google Play Music 1.0

Like a song but make sure the song isn't already liked before clicking the like button

  1. joaomgcd
    After installing this profile you can say any AutoVoice command with the words "like" and "song" in it and it'll like the currently playing song in Google Play Music.

    Important: This works on the Nexus 6's screen only. On other devices you may need to use different coordinates in the "AutoInput Screen Capture" action. Also, Google Play music must currently be showing on your screen and playing an instant mix so that the like button is visible.

    The way it works is:
    • Capture the pixel color where the little "like" hand is
    • If the color is #212121 that means that the song is already liked, so don't do antyhing
    • If the color is anything else, click the like button
    An easy way to find the correct pixel to capture is this:
    • in the developer settings on your phone, enable "Pointer Location"
    • get the pixel coordinates for the top left area of the button you want to capture. In this example, click the top left part of the button. [​IMG]
    • Add an "AutoInput Screen Capture" Action in Tasker and set the crop to "x,y,50,50" (no quotes) where you replace x and y with the pixel coordinates you found before
    • Add an "Open File" action with %aiscreenshotfile as the file path
    • Run the task and see if you got a correct capture of the button.
    • If not, tweak the x and y coordinates above and run again.
    • Make sure that the top left of the captured image is "inside" the button, so that it contains the color of the pixel you want to capture like this for example: [​IMG] Here the top-left most pixel is the color you want to capture to check if the button is pressed.
    • when you have the pixel you want, set the "Pixel Color" field in the "AutoInput Screen Capture" Action to "0,0" (which will make you get the color of the top-left most pixel of the cropped image)
    • When you now run the task and do a flash with %aiscreenshotpixelcolor you'll have the color you want