Spotify Web - Save to Favorites Hotkey

Get help with using AutoHotkey and its commands and hotkeys
ahkfan
Posts: 10
Joined: 14 Feb 2018, 20:01

Spotify Web - Save to Favorites Hotkey

21 Jul 2018, 22:24

I know that there is AHK solution for Spotify app, but nothing for web player.
I'm using Spotify web player for Firefox, because standalone app is not working for countries where Spotify is not officially launched, but webplayer works fine. There is addon which allows to use media keys (play/pause/prev/next) in Firefox so all I need is 'Save to Favorites' hotkey.

CSS Class name for not yet added song is .spoticon-heart-16
For the added it is .spoticon-heart-active-16

So the goal is to press the add song button when hotkey is pressed if the class shows that it's not yet added, and ignore hotkey otherwise.

Thank you.
ahkfan
Posts: 10
Joined: 14 Feb 2018, 20:01

Re: Spotify Web - Save to Favorites Hotkey

23 Jul 2018, 15:06

I made this script which clicks a button in my browser (with spotify web player) without any checks:

Code: Select all

^!Up:: ControlClick, x969 y992, spotify, , Left, 1, NA
In this example I'm clicking on Play button, because it's always on its place unlike the "Save to your Favorite Songs" heart-shaped button, which is not only changing its color, but also is changing position depending on length of a song title and playing mode.

The color code of the button when it shouldn't be pressed:
1ED760 (Red=1E Green=D7 Blue=60)

So the goal is that script should check the color of the button and adjust to its changing positions.
Last edited by ahkfan on 23 Jul 2018, 15:20, edited 1 time in total.
ahkfan
Posts: 10
Joined: 14 Feb 2018, 20:01

Re: Spotify Web - Save to Favorites Hotkey

23 Jul 2018, 15:14

I removed the song titles using an addon to edit CSS styles. The "Save to your Favorite Songs" button is no longer moving.
So the only thing, that's left is to check if the color is 1ED760. If it is - don't press.
Any ideas on how to do it, could you please help, guys?

Return to “Ask For Help”

Who is online

Users browsing this forum: Bing [Bot], Google [Bot], Hatsuko, rubiksolver, swagfag, Xtra and 34 guests