Liking songs on Spotify has always been such a pain. It's virtually the only thing in Spotify which does not have a keyboard shortcut. There is no applescript for it. There is no menu item for it. No third-party Spotify addon could do it, and I tried at least a dozen. Any of those things would easily allow scripting or a custom keyboard shortcut.
But no, the only way to like the song is to click the tiny heart icon in the Spotify app. Which is also not easily scriptable, as the heart icon literally changes the position depending on the length of the song name.
So finally I stumbled upon keyboard maestro a couple of days ago and tried it out. And after creating a few macros and slowly understanding what KM's capabilities are, I took upon the challenge. And I finally, finally did it: with the mouse-click based on a found image, I could eventually set a hotkey for liking a song.
It isn't even a very complicated macro, but I thought maybe others would like to use it, too.
Having created about two dozen custom workflows in Alfred, I am slowly recognizing how far the rabbit hole goes with Keyboard Maestro. Spent the last two evenings writing a bunch of window management macros. Gained enough window control to uninstall Moom
Welcome @pseudo_meta
Don't know Spotify interface, but if this is a web-interface, KM can also find a Safari field or button, so there may be no need to use activate/pause and other GUI actions.
I was able to get the Spotify App on Mac to play a specific playlist using the following script.
The script will automatically launch Spotify and play the specified playlist.
tell application "Spotify"
play track "spotify:playlist:37i9dQZF1DX84kJlLdo9vT"
end tell
The playlist ID is from right click on "Share > Copy link to playlist"