Python comtypes Photoshop 64-bits

579 views Asked by At

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!

0

There are 0 answers