I tried the other Autohotkey shortcut and it didn't work for me (just switched to spotify and clicked in two dead spots). I devised the following, which works so long as you have "Large Now Playing Artwork" selected:
CoordMode, Mouse, Relative
;star currently playing
+^l::
SpotifyWinHeight = 1050 ;set to 1080 - 30 for small taskbar size, just in case WinGetPos doesn't work for some reason
WinGetActiveTitle, CurWindow
WinActivate Spotify
WinWaitActive Spotify
WinGetPos, , , , SpotifyWinHeight, Spotify
; X Y W H, we don't care about anything but height
RightClickTarget := SpotifyWinHeight - 250
ContextMenuTarget := RightClickTarget + 110
MouseMove, 100, %RightClickTarget%
Click Right
Sleep, 50
MouseMove, 180, %ContextMenuTarget%
Sleep, 50
Click
WinActivate %CurWindow%
return
It does the following:
- Stores currently active window
- Activates Spotify
- Calculates the offsets for clicking on the album artwork relative to spotify window
- Stars what's currently playing (via right-click artwork, left click Star)
- Restores whatever window was active before all of this
It's not perfect (will probably not be happy if for some reason you have spotify hanging mostly off your screen to the right), but gets the job done in most cases.