How to add a track to Library in Apple Music using Apple Script I searched through a few posts online and most of them say to use this:
tell application &quot;Music&quot;
    duplicate current track to source &quot;Library&quot;
end tell

...but I get the following error:
&quot;Music got an error: Can’t set source \&quot;Library\&quot; to current track.&quot; number -10006 from source &quot;Library&quot;
Did Apple change/remove adding a track to the Library? I can't find any update on this and Apple's docs on this are nonexistent.
I'm not in front of a Mac at the moment, so can't test this, but what happens if you try the following:
tell application &quot;Music&quot;

    set newFile to (choose file with prompt &quot;Select track you want to add...&quot;)

end tell

Of course, you can change the 'prompt' text to whatever you want.
Also, in case you're wanting to, you should be able to get the script to add the track to a specific playlist by adding the following line after the set newFile line:
add newFile to playlist &quot;Newly added tracks&quot;

Of course, you can change the 'playlist' name by changing the text within the quotation marks to whatever you want.