Python comtypes Photoshop 64-bits

*爱你&永不变心* 提交于 2019-12-11 02:53:35

问题


I have been using the comtypes module for Python to automate Photoshop CS5, but I am getting a TypeError when I try to execute commands on Photoshop 64-bit. These same commands have been working fine on Photoshop 32-bit.

This an example of the code I am using:

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)

And this is the Traceback I get:

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

I'm pretty new so if anyone can point me in the right direction I would really appreciate it!

来源:https://stackoverflow.com/questions/25401567/python-comtypes-photoshop-64-bits

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!