On 7/3/07, KuhlmannSascha <[EMAIL PROTECTED]> wrote: > 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
It looks like win32com thinks you have a IITPlaylist, and you really have a subclass of that, a IITUserPlaylist. You need to cast it like this: import win32com.client iTunes = win32com.client.gencache.EnsureDispatch('iTunes.Application') playlists = iTunes.LibrarySource.Playlists for playlist in playlists: if playlist.Kind == 2: playlist = win32com.client.CastTo(playlist, 'IITUserPlaylist') print "Name: ", playlist.Name print "Kind: ", playlist.Kind print "Smart: ", playlist.Smart print -- Jerry -- http://mail.python.org/mailman/listinfo/python-list