win32com.client.Dispatch returns CLSID different than makepy

S

Stefano Masini

I'm trying to script Adobe InDesign CS from python thru COM, and I'm
having a horrible time to even get started.

I ran makepy, and chose "Adobe InDesign CS Type Library".
It produced a horribly named module inside the gen_py directory, and
when I run gencache.py -d I get this:

Cache is in directory C:\Python23\lib\site-packages\win32com\gen_py
Adobe InDesign CS Type Library -
{6926C15F-E97E-4b13-8658-A97D8C616945}

Therefore it looks like everything worked so far, and the type library
for InDesign has the Class ID {6926C15F-E97E-4b13-8658-A97D8C616945}

Now, when I write the following python code:

comApp = win32com.client.Dispatch('InDesign.Application')
print repr(comApp)

I get:

<COMObject InDesign.Application>

Which looks like a dynamic dispatch, rather that a static one, as it
should be since I ran makepy on purpose.

Indeed, I manually placed some print statements around the win32com
python source code and I figured out that the name
'InDesign.Application' (I also tried with 'InDesign.Application.CS')
maps to the Class ID {ABD4CBB2-0CFE-11D1-801D-0060B03C02E4}.
This is different from the one produced by makepy, and therefore the
dispatch method can't find anything in cache, and falls back to
dynamic behaviour.

Anybody have a clue on what's going on here?

I thought I ought to write something different that
'InDesign.Application'... so I tried 'Adobe.InDesign.Application',
'Adobe.CS.....' and all sorts of things, but no luck.

Once I chose the 'Adobe InDesign CS Type Library' from makepy, how do
I know what am I supposed to use as the parameter to Dispatch() ?

Thank you very much, I hope somebody helps me out.
Maybe with some useful readings...
 
E

Erick Bodine

I saw something similar when I ran makepy on "Microsoft CDO for
Exchange Management Library". I emailed the list but got no response
<shrugging shoulders>

Out of curiousity, are you using ActivePython's distribution or Python
+ latest win32all ?

--ERick
 
M

Markus Wankus

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,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top