Lets you add artwork to tracks in iTunes.
OS version: OS X
set theImage to read (choose file) as picture
tell application "iTunes"
set theP to view of front window
tell theP
set data of artwork 1 of track 1 to theImage
end tell
end tell
This script still works (I have Music.app on Catalina OS). I decided to add 2 other ways that also work (tested)
-- any image. NOTE: Please don't choose very large image file
set theImage to read (choose file of type {"public.image"} without multiple selections allowed) as picture
-- add artwork to selected tracks of front browser window
tell application "Music" to tell front browser window
repeat with selectedTrack in (get selection)
set data of artwork 1 of selectedTrack to theImage
end repeat
end tell
-- OR: add artwork to certain track of front browser window's view
(*
tell application "Music" to tell view of front browser window to ¬
set data of artwork 1 of track 3 to theImage
*)
-- OR: add artwork to currently playing track
(*
tell application "Music"
set curTrack to current track
set data of artwork 1 of curTrack to theImage
end tell
*)