[python-win32] iTunes COM using Python win32
Mark Hammond
mhammond at skippinet.com.au
Fri Feb 2 00:24:52 CET 2007
I'd guess that one box has had makepy run for that type-library, but the
other hasn't. Look into using the win32com.client.gencache module to
programatically generate makepy support, and it should then happen
everywhere you run it.
HTH,
Mark
-----Original Message-----
From: python-win32-bounces at python.org
[mailto:python-win32-bounces at python.org]On Behalf Of Alden Lavizzo
Sent: Friday, 2 February 2007 6:43 AM
To: python-win32 at python.org
Subject: [python-win32] iTunes COM using Python win32
Hi,
The following code works perfectly well on one of my machines, but gives
me an error on another:
iTunesApp = WScript.CreateObject("iTunes.Application");
pl = iTunesApp.LibraryPlaylist
tracks = pl.Tracks
myTrack = tracks[0]
myNewList = iTunesApp.CreatePlaylist("My New List")
myNewList.AddTrack(myTrack)
I get the following error message:
Microsoft (R) Windows Script Host Version 5.6
Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.
C:\Alden\src\Apps\PhatPod\test.pys(10, 0) Python ActiveX Scripting Engine:
Traceback (most recent call last):
File "<Script Block >", line 10, in ?
myNewList.AddTrack(myTrack)
File "C:\Python24\Lib\site-packages\win32com\client\__init__.py", line
454, in __getattr__
raise AttributeError, "'%s' object has no attribute '%s'" %
(repr(self), attr)
AttributeError: '<win32com.gen_py.iTunes 1.8 Type Library.IITPlaylist
instance at 0x29470352>' object has no attribute 'AddTrack'
Does anyone know why one machine would work, while another wouldn't?
Improper machine setup, maybe? I've followed every step twice in setup.
Thanks,
Li
--
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/python-win32/attachments/20070202/d888081c/attachment.htm
More information about the Python-win32
mailing list