I searched for 'playlists' and 'add to playlist' but didn't see what I'm looking for. Maybe I missed it?
What I'd like to do:
While listening to a playlist, I'd like the ability to add the current track to one of two other playlists.
Expanding further, I have a library I share with others in the household, so using the Like, star ratings, etc., doesn't work well. I've created a folder for myself and under that, these playlists: Like, Don't Like, and Sorting Hat (all songs in the library where they do not belong to either of the aforementioned playlists).
So, while listening to the playlist 'Sorting Hat' while at my desk doing other things, I'd like to fire off a KBM menu where I can select which playlist to add the current song to (Like or Don't Like).
I really thought I'd find something about adding a current song to a playlist, but I'm clearly missing it.
Neither of these worked for me unfortunately. The menu is disabled using the suggestion by @bolero In the suggestion by @Tom , it doesn't end up appearing in the playlist.
The one caveat seems to be that the track already needs to be in a Playlist (or has been Added to the Library) before this will work. Playing the track from within a Playlist (or from the Library) and running the Macro allows it to be added to another Playlist. But if the track is just played direct from Apple Music (i.e. it hasn't yet been added to the Library) and the Macro is run, it fails to add it to a Playlist. Not sure exactly why - maybe it is the command "duplicate"? (EDIT - Just found out this is a quirk going right back to iTunes days. Tracks played direct from Apple Music have the "Add to Playlist" menu item grayed out. Frustratingly the right-click context manu still works but is not as easy to automate).
Anyway, this is the AppleScript that works (as long as the playing track is already in a Playlist or is being played from the Library)
tellapplicationid "com.stairways.keyboardmaestro.engine" set inst tosystem attribute "KMINSTANCE" set thePlaylist togetvariable "Local__Playlist" instance inst endtell tellapplication "Music" toduplicate current track to playlist thePlaylist