问题
I have the exact same problem than the one described in this topic, with Photoshop CC 2017, python 2.7.13, comtypes 1.1.3, windows 7 (all 64-bits)
Trying to call a Photoshop method via python + comtypes raises a TypeError saying that the object is not callable:
from comtypes.client import CreateObject
psApp = CreateObject("Photoshop.Application.110") # edited to match photoshop CC 2017
#Create a new document- this is where it bombs out!
psApp.Documents.Add(1024, 1024, 72, 'new_source_texture', 2, 1, 1)
Traceback (most recent call last):
File "test.py", line 9, in <module>
psApp.Documents.Add(1024, 1024, 72, 'new_source_texture', 2, 1, 1)
TypeError: '_Dispatch' object is not callable
...accessing it as if it were a property actually invoke the method with default args:
psApp.Documents.Add #without explicit call
Has anyone encountered or solved this issue?
thanks!
Paul
来源:https://stackoverflow.com/questions/45174628/photoshop-cc-2017-python