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
ます。