Skip to main content
Inspiring
August 13, 2021
Question

Trying to make a contacts sheet using ExtendScript DOM in python

  • August 13, 2021
  • 0 replies
  • 159 views

I'm trying to make a contact sheet using the ExtendScript DOM for photoshop.

 

I'm using this api from github, which allows me to do it with python 

 

from win32com.client import Dispatch, GetActiveObject
from os import walk, path

psApp = GetActiveObject("Photoshop.Application")

CSInputFiles = [path.join(r, f) for r, sd, fs in walk('InputFile') for f in fs]

CSoptions = [True, psApp, False, False, 6, True, None, 0, 7, 4, 3, 300, 3, None, True]

psApp.MakeContactSheet(psApp, CSInputFiles, CSOptions)

How ever I keep getting the following error "TypeError: MakeContactSheet() takes from 1 to 3 positional arguments but 4 were given"

 

I've treid removing the psApp refrence but then I get this error:

"pywintypes.com_error: (-2147352567, 'Exception occurred.', (0, 'Adobe Photoshop', 'Illegal argument - argument 2\n- Object expected', None, 0, -2147220261), None)"

 

According to the documentation the InputFiles and Options arguments for MakeContactSheet need to be arrays; an array of string, then a mixed array of options respectivly.

 

Any help would be greatly appreciated

This topic has been closed for replies.