How can i change an Object type ?

kyosohma at kyosohma at
Wed Jul 4 19:14:05 CEST 2007

On Jul 4, 12:40 am, Tim Roberts <t... at> wrote:
> KuhlmannSascha <Sascha.Kuhlm... at> wrote:
> >i tried now for several hours to read through a win32com API to access
> >Itunes and read out myplaylists.
> >First of all the Code:
> >...
> >The current Logic is to access first Itunes and then a Playlist
> >Collection.
> >This Playlist collection returns different kind of objects for
> >Playlists.
> >I am focussing on the Playlists of the object UserPlaylist.
> >(CodeLine:   if curPlaylist.Kind == 2:)
> >After that i should be sure to have a UserPlaylist, but Python stops
> >with an exception that the requested Attribute "Smart"  is not
> >available
> >Error MEssage:
> >AttributeError: '<win32com.gen_py.iTunes 1.9 Type Library.IITPlaylist
> >instance at 0x30216960>' object has no attribute 'Smart'
> Smart is part of IITUserPlaylist, not IITPlaylist.  You need to call
> curPlaylist.QueryInterface to get the IITUserPlaylist, but that means
> you'll need to know the GUID for IITUserPlaylist.  Perhaps Google will
> help.
> --
> Tim Roberts, t... at
> Providenza & Boekelheide, Inc.

These look like they could give you some pointers too:


More information about the Python-list mailing list