2

我一直在使用 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

我很新,所以如果有人能指出我正确的方向,我将不胜感激!

4

0 回答 0