我正在尝试从 pict 文件中捕获艺术品,并使用 python appscript 将其嵌入到 iTunes 上的轨道中。我做了这样的事情:
imFile = open('/Users/kartikaiyer/temp.pict','r')
data = imFile.read()
it = app('iTunes')
sel = it.current_track.get()
sel.artworks[0].data_.set(data[513:])
我收到错误 OSERROR: -1731 MESSAGE: Unknown object
类似的 applescript 代码如下所示:
tell application "iTunes"
set the_artwork to read (POSIX file "/Users/kartikaiyer/temp.pict") from 513 as picture
set data of artwork 1 of current track to the_artwork
end tell
我尝试使用 ASTranslate 但它从不实例化the_artwork
,然后在引用the_artwork
.