win32com.client.GetActiveObject()

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • David Nicolson

    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.Ensur eDispatch("iTun es.Application" )
    iTunes = win32com.client .Dispatch("iTun es.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 .GetActiveObjec t("iTunes.Appli cation")
    iTunes = win32com.client .GetObject(Clas s = "iTunes.Applica tion")

    Both lines result in a pythoncom.com_e rror 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

  • Roger Upole

    #2
    Re: win32com.client .GetActiveObjec t()

    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" <davidnicolson1 @hotmail.com> wrote in message news:mailman.58 1.1127099639.50 9.python-list@python.org ...[color=blue]
    > Hi,
    >
    > I have been successfully using iTunes' COM interface with Python using either of the following lines successfully:
    >
    > iTunes = win32com.client .gencache.Ensur eDispatch("iTun es.Application" )
    > iTunes = win32com.client .Dispatch("iTun es.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 .GetActiveObjec t("iTunes.Appli cation")
    > iTunes = win32com.client .GetObject(Clas s = "iTunes.Applica tion")
    >
    > Both lines result in a pythoncom.com_e rror 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
    >[/color]



    ----== 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 =----

    Comment

    Working...