I’m trying to make a selection in photoshop and can’t figure out how to get the right type of data to the Select method.
The VBScript docs say:
Select
(Region Array (Points: Array (Array (x,y),…)
[, Type]
[, Feather]
[, AntiAlias])
I can’t figure out how to give it a Region that it will accept:
psApp = win32.dynamic.Dispatch('Photoshop.Application')
doc = psApp.Documents(1)
doc.Selection.Select((0, 0, 512, 512))
I get: pywintypes.com_error: (-2147352567, ‘Exception occurred.’, (0, u’Adobe Photoshop’, u’Illegal Argument’, None, 0, -2147024809), None)
If I nest the region:
psApp = win32.dynamic.Dispatch('Photoshop.Application')
doc = psApp.Documents(1)
doc.Selection.Select( ((0, 0), (512, 512)) )
I get: [I]pywintypes.com_error: (-2147352567, ‘Exception occurred.’, (0, u’Adobe Photoshop’, u’Illegal argument - argument 1
- Only arrays with dimension 1 are supported’, None, 0, -2147220262), None)[/I]