comtypes
comtypes copied to clipboard
Unable to create Illustrator object
Usage:
from comtypes.client import GetActiveObject, CreateObject
app = CreateObject("Illustrator.Application")
Error:
Traceback (most recent call last):
File "C:/Users/username/Documents/GitHub/illustrator-scripting-python/illustrator-test.py", line 10, in <module>
app = CreateObject("Illustrator.Application")
File "C:\Users\username\Documents\GitHub\illustrator-scripting-python\env\lib\site-packages\comtypes\client\__init__.py", line 250, in CreateObject
return _manage(obj, clsid, interface=interface)
File "C:\Users\username\Documents\GitHub\illustrator-scripting-python\env\lib\site-packages\comtypes\client\__init__.py", line 188, in _manage
obj = GetBestInterface(obj)
File "C:\Users\username\Documents\GitHub\illustrator-scripting-python\env\lib\site-packages\comtypes\client\__init__.py", line 112, in GetBestInterface
interface = getattr(mod, itf_name)
AttributeError: module 'comtypes.gen.Illustrator' has no attribute '_Application'
Similar COM call from vb-script works, example Set appRef = CreateObject("Illustrator.Application")