我一直使用Python的comtypes模块来使Photoshop CS5自动化,但是当我尝试在Photoshop 64位上执行命令时遇到TypeError。这些相同的命令在Photoshop 32位上运行正常。
这是我正在使用的代码示例:
from comtypes.client import CreateObject
psApp = CreateObject("Photoshop.Application")
#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
我很新,所以如果有人能指出正确的方向,我将不胜感激!