How to star a Spotify song while it's minimized?

Okay so the Spotify application on Windows does not have inbuilt support for global hotkeys, and very basic hotkeys even when the application window is currently active. Frustratingly 'starring' the song that is currently playing does not have a keyboard shortcut, even when the window is active.

So I have an Autohotkey script that gives me global hotkeys for playback control, volume and copying the song title (including em dash fixing) but I've hit a brick wall trying to figure out how to star the current song.

To make matters even harder, I only want the Autohotkey script to star the song if it's not already starred. If it's already starred then just leave it alone.

I want all this to happen when the Application is in the tray, without opening the window.


EDIT: Semi-working solution

So I've come up with a reasonably solution, it opens up a context menu even when the program is minimized and does everything including not unstarring songs. Unfortunately the context menu means that it will minimize full-screen applications like games for a split second. Depending on the game that can be a pain, but it's the best I can do without fancy DLL calls and stuff.

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.

;|---------------|
;|--[ SOURCES ]--|
;|---------------|
;Base Spotify Script from: http://www.autohotkey.com/board/topic/36239-spotify-global-hotkeys/
;Base Starring Script from: http://superuser.com/questions/324416/any-spotify-tweaks-with-keyboard-shortcut-to-star-tracks

;|------------------|
;|--[ SETTING UP ]--|
;|------------------|
DetectHiddenWindows, On ;Detect Spotify even if it's minimized
#IfWinExist ahk_class SpotifyMainWindow ;Only 
Edit
Report