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:
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.
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.