AppleScript to retrieve track properties in Music no longer working in Big Sur

I use AppleScript handlers within a Swift macOS app to retrieve song details for the currently playing track in Music. This has worked well through several iterations of macOS and Music up through Catalina.

In Big Sur, the script continues to work with tracks that have been added to the user’s library. However, the AppleScript handlers no longer return any track properties (or anything at all) if the song is streaming, for instance when playing from a “Listen Now” playlist. In Catalina, the handlers return all the track properties whether or not the track has been added to the library.

This problem exists even if I run the commands in Script Editor directly: success with added tracks, nothing with streaming tracks. A simple example:

Code Block
tell application "Music"
set songTitle to name of current track
return songTitle
end tell

I know from searching other forums that others are experiencing the same problem. Does anyone have more information about this? Is there a workaround?

I tried other properties from the Music sdef, such as “current stream title”, but that doesn’t seem to work with any kind of track.

As I recall, a previous macOS upgrade broke the same thing (I forget which version it was.), and it was eventually fixed. I hope that it gets fixed again soon. This functionality is critical to my app.

Accepted Reply

The Big Sur 11.3 update did finally fix this issue. You can once again use AppleScript to get the album artwork of the current track even if the track hasn’t been added to your music library.

Replies

Got the same problem. Would also be interested in a workaround.
Big Sur 11.2 will likely be released in the next week or two. I’m not optimistic that they’ve fixed this (I don’t see any mention of it in beta forums), but we can hope.
This should really be fixed Apple!

Or you have to release a statement, that this will be gone in the future, which would be really sad.
Every Last.fm scrobbling app is basically broken at the moment because they depend on this property. Getting song information works fine as long as they're being played from your library. I tried other properties as well with no luck. Music.app is a mess. I hoped things would become better after scrapping iTunes, but now this...
Same issue here. AppleScript still can not retrieve track info on macOS 11.3 Beta in stream mode.
I can confirm that this issue has been fixed in today's release of macOS Big Sur 11.3 beta 2.
The Big Sur 11.3 update did finally fix this issue. You can once again use AppleScript to get the album artwork of the current track even if the track hasn’t been added to your music library.
@packafoma best news this week so far 🤌
Just a quick observation that the album name doesn't always work still. It's sporadic and I can't figure out what makes it succeed or not (yet).

It's sporadic and I can't figure out what makes it succeed or not
(yet).

When you finish your investigation please put the results in a bug report, and then post your bug number here, just for the record.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"
And we are back. It's not possible to add the current track to the library since 20E241.

@blue_lander I noticed that too. Even though song title, artist, and cover art now work, I still can’t get the album name for any track that has not been added to my library.