Hello. For years my streamdeck has called a KbM macro to Execute AppleScript:
tell application "Music"
set comment of selectedTracks to "@a"
end tell
and worked beautifully. Five keys assign 5 different values to the comment field to indicate my preferences.
Note that this is for the selected track rather than playing. It’s now broken. I have this:
tell application "Music"
if player state is playing then
set comment of current track to "@aa"
end if
end tell
which works for the currently playing track irrespective of selection, which is precisely what I don’t want.
I’ve tried these:
tell application "Music"
set theTrack to first item of (get selection)
set comment of theTrack to "Your new comment text goes here."
end tell
and one other that failed too.
(FWIW The underlying mechanics work, as the unwanted playing track macro does its job. And the Streamdeck is okay too, as circumventing it and directly calling KbM doesn’t affect the outcome.)
Be delighted if one of you boffins could solve this. Thanks as always!
You may need to indicate which version of macOS you are using, because I think the latest version of macOS has changed some of the behaviour of Apple Music, specifically how AppleScript interacts with it.
If you are willing, you could try reverting to an older version of macOS (or just try a Mac with an older OS) to prove my claim above.
Hello Airy. As in the title it’s macOS 26.0.1. And it’s more about the syntax as far as I can see; as it’s purely a result of the OS upgrade rewinding that isn’t a logical step for me. And I agree that it’s likely to be how AS and Music interact; I’m sorry I didn’t make that clear. Thanks for taking the time, though.
This'll probably only be fixed when Apple fixes it -- hopefully in the coming-soon 26.1 update. See this thread for similar examples of Music's AppleScript (and, by extension, KM) support getting broken.