[python-win32] Python win32com and iTunes
Tim Roberts
timr at probo.com
Wed Oct 11 19:01:15 CEST 2006
Test Drive wrote:
> Hi All,
>
> I am trying to use win32com with iTunes (version 7.0.1.8
> <http://7.0.1.8>). However it seems like I am missing something and I
> am clueless about that.
>
> <code>
> import win32com.client as wc
> import pythoncom,sys
>
> app=wc.Dispatch('iTunes.Application')
> mainPl=app.LibraryPlaylist
>
> print ">>>>>>>>>>>>>> Dir <<<<<<<<<<<<<<<<<<"
> print dir(mainPl)
>
> print ">>>>>>>>>>>>> Help On PlayFirstTrack <<<<<<<<<<<<<"
> print help(mainPl.PlayFirstTrack)
>
> mainPl.PlayFirstTrack ()
> sys.exit(-1)
> </code>
>
> <output>
> ... Start playing the first track in this playlist.
>
> None
> Traceback (most recent call last):
> File "iTunesmin.py", line 13, in ?
> mainPl.PlayFirstTrack()
> File
> "c:\python24\lib\site-packages\win32com\gen_py\9E93C96F-CF0D-43F6-8BA8-B8
> 07A3370712x0x1x8\IITLibraryPlaylist.py", line 80, in PlayFirstTrack
> return self._oleobj_.InvokeTypes(1610809345, LCID, 1, (24, 0), (),)
> pywintypes.com_error: (-2147352567, 'Exception occurred.', (0, None,
> None, None,
> 0, -2147418113), None)
Hmmm, -2147418113 is 0x8000FFFF, which is the rather catchall error
E_UNEXPECTED. It generally means you did things out of order. Is it
possible that it needs more initialization before launching the first track?
--
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.
More information about the Python-win32
mailing list