[Pythonmac-SIG] Any appscript / iTunes experts out there?
Matt Patenaude
MattPat at mattpat.net
Tue Mar 4 19:32:22 CET 2008
> Anyone know how to add artwork to a file??
I just did something like this myself a few days ago. :) A quick
snippet from my script:
iTunes = app('iTunes')
artworksForTrack = iTunes.current_track.artworks.get()
artwork = artworksForTrack[0].get()
dataString = artwork.data.get().data
# Assume fname is your file name
f = open(fname, 'wb')
# When we write, we chop off the first 221 bytes to get rid of the
pict header
f.write(dataString[222:])
f.close()
Hope it helps!
Matt Patenaude, Developer for OS X and the Web
Blog: mattpat.net
Portfolio: mattpatenaude.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20080304/b7145006/attachment.htm
More information about the Pythonmac-SIG
mailing list