471,119 Members | 1,429 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,119 software developers and data experts.

win32com.client.GetActiveObject()

Hi,

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

iTunes = win32com.client.gencache.EnsureDispatch("iTunes.Ap plication")
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.Applicatio n")
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

Sep 19 '05 #1
1 9538
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

"David Nicolson" <da************@hotmail.com> wrote in message news:ma************************************@python .org...
Hi,

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

iTunes = win32com.client.gencache.EnsureDispatch("iTunes.Ap plication")
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.Applicatio n")
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


----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
Sep 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Justin Stockton | last post: by
3 posts views Thread by RJ | last post: by
reply views Thread by Paul McGuire | last post: by
2 posts views Thread by Sibylle Koczian | last post: by
2 posts views Thread by Ray | last post: by
11 posts views Thread by Bill Davy | last post: by
4 posts views Thread by sterling | last post: by
2 posts views Thread by RyanN | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.