I'm using python to automate an action in photoshop.
I want to select an area but I get this error:
Traceback (most recent call last):
File "<pyshell#90>", line 1, in <module>
docRef.Selection.Select(sel_area)
File "<COMObject <unknown>>", line 3, in Select
pywintypes.com_error: (-2147352567, 'Exception occurred.', (0, 'Adobe Photoshop', 'Illegal argument - argument 1\n- Only arrays with dimension 1 are supported', None, 0, -2147220262), None)
My code:
from win32com.client import Dispatch
app = Dispatch("Photoshop.Application")
file=r"dog.bmp" #size = 512*512
docRef=app.Open(file)
sel_area = ((0,0), (0, 10), (10, 10), (10, 0))
docRef.Selection.Select(sel_area)
All the examples I saw did the same thing as I do.
What exactly I need to change to pass it as 1D array?
UPDATE
turns out WinCom32
has problems passing arrays properly.
I moved to comtypes
and it works perfect.