I am unable to find any information on the error that this snippet is creating.
set theImage to read (choose file) as picture
tell application "iTunes"
set theP to view of front window
tell theP
try
set data of artwork 1 of track 1 to theImage
on error errMsg number errNum from errFrom partial result errResult to errTo
display dialog errMsg
end try
end tell
end tell
iTunes got an error: An error of type -116 has occurred.
I have also tried this:
set theData to "Macintosh HD2:Users:brandonc:Desktop:0008539373162_500X500.jpg" as alias
set theImage to read (theData) as picture
tell application "iTunes"
set this_track to (item 1 of index of selection)
set theP to view of front window
tell theP
set theArt to front artwork of track this_track
--set pic to (data of theArt) as picture
try
set data of theArt of this_track to theImage as picture
on error errMsg number errNum from errFrom partial result errResult to errTo
display dialog errMsg
end try
end tell
end tell
errFrom = theArt of 1
errMSG = Can’t get theArt of 1.
errNum = -1728
errResult = list of 0 items
errTo = list of 0 items
This gives me a differant error, probably due to not having built a list.
I could use some insight to how to do this bit of code.