This AppleScript workflow detects if a song is being played on Apple Music or Spotify, then extracts the names of both the artist and the song, composes a string using a template and copies it to your clipboard.
This is the template used to compose the final string. The URL will only appear if the song is played on Spotify.
♬ <SONG_NAME> - <ARTIST_NAME> [URL] #Spotify|AppleMusic #NowPlaying
♬ Woman - Wolfmother #AppleMusic #NowPlaying
♬ Royals - Lorde http://open.spotify.com/track/4zztp85oS36ijgAWwyhX8p #Spotify #NowPlaying
Download the .alfredworkflow file from the dist folder, double click it, and that's it!
- Play some stuff on Apple Music or Spotify.
- Launch Alfred, type
now
, hit enter and the string should be in your clipboard ;)