win32com.client.GetActiveObject()

D

David Nicolson

Hi,

I have been successfully using iTunes' COM interface with Python
using either of the following lines successfully:

iTunes = win32com.client.gencache.EnsureDispatch("iTunes.Application")
iTunes = win32com.client.Dispatch("iTunes.Application")

The only problem is that it will launch iTunes if it is not running
by instantiating the object here. There are some reasons why I have
not attempted to use more COM to check if iTunes is an active
process, I tried either of the following lines to only form a
connection if iTunes is running.

iTunes = win32com.client.GetActiveObject("iTunes.Application")
iTunes = win32com.client.GetObject(Class = "iTunes.Application")

Both lines result in a pythoncom.com_error with 'Operation
unavailable' in the second element of the tuple. Has anyone been able
to successfully do this with iTunes' COM server? I have seen other
'Operation unavailable' messages in a few other mailing lists but was
unable to find any solutions to this problem.

Regards,
David
 
R

Roger Upole

Basically, this means the application doesn't register itself
with the Running Object Table. There's not much you can
do about it, except maybe petition whoever makes ITunes.

Roger
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top