Accessing iTunes with Python via the Windows SDK

Denrael learned at gmail.com
Thu May 24 01:59:58 EDT 2007


On May 24, 12:17 am, Tony Meyer <tony.me... at gmail.com> wrote:
> On May 24, 4:23 pm, Denrael <lear... at gmail.com> wrote:> I've been playing with the iTunes sdk on windows, and have come across
> > a strange problem.  With the following code:
>
> The object you get back from iTunes.CurrentTrack (the traceback shows
> this) is an IITTrack.  If you check the iTunes SDK, you'll see that
> IITTrack objects don't have a "SkippedCount" attribute -
> IITFileOrCDTrack objects do (from memory, this excludes things like
> radio links).  You need to conver the IITrack object to a
> IITFileOrCDTrack object (assuming that it is one); you can do this
> with win32com.client.CastTo, as follows:
>
> Cheers,
> Tony

Thanks Tony!

I had a suspicion it had to do with casting it, but I was missing some
synapses to figure out exactly how to do that. Things have changed
from my Assembly Language PL/1 and REXX days.  :) I figure if I'm
gonna learn a new language, Python's a lot more usable than VBS, and
it has an elegance to it that I already appreciate. I'm working my way
thru Learning Python ... I suppose I better find some doc on the Win32
COM stuff too.




More information about the Python-list mailing list