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: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Alden Lavizzo
  Sent: Friday, 2 February 2007 6:43 AM
  To: python-win32@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

  --
_______________________________________________
Python-win32 mailing list
Python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32

Reply via email to