Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Contact Sheet #76

Open
GoGoGadgetGitHub opened this issue Aug 27, 2021 · 3 comments
Open

Contact Sheet #76

GoGoGadgetGitHub opened this issue Aug 27, 2021 · 3 comments

Comments

@GoGoGadgetGitHub
Copy link

Bug Discription:

The problem I'm experiencing is with the Application.makeContactSheet command. According to the documentation it has two arguments. An array of files (paths to all images that need to be on the contact sheet), and an array of options. However I've never been able to make it work.

Here is what I'm currently trying to do:

import photoshop.api as ps
from win32com.client import Dispatch
from os import path, walk
import inspect

dispatch = Dispatch("Photoshop.Application")  #Open PS
api = ps.Application()  #Application Object
Source = "Path to folder with all files"

files = [path.join(r,f) for r, sd, fs in walk(Source) for f in fs]  #Making an array of paths
options = [True, psApp, False, False, 6, True, None, 0, 7, 4, 3, 300, 3, None, True]

api.makeContactSheet(files , options )

I suspect that options array is incorrect, because I get this error:
Illegal argument - argument 2\n- Object expected

I then decided to remove this array (Still not sure what I did wrong). Which helped me get as far as opening the Contact Sheet Dialog Window. However as you can see from the screenshot below, no files were selected.

Screenshot 2021-08-27 110546

Any help would be greatly appreciated. If you need any more information, please don't hesitate to ask.

  • OS: Windows 10
  • Photoshop Version: Photoshop-2021
  • Python Version: python-3.9

Additional Context:

I'm trying to write a script that will make contact sheets for me. My end goal is to make a program that will create composite images containing all images I throw in a folder. I'm aware of the ContactSheet II script included in photoshop, the problem I have with this is you need to run it folder by folder. I want automate the entire process. Select a folder containing sub folders that I need to make contact sheets of and just let it run. The amount of images in each file is a variable, so I need to generalize the size of the image, the gap between them and the amount of rows and columns, based on that.

@loonghao
Copy link
Owner

loonghao commented Sep 4, 2021

Hi @GoGoGadgetGitHub
makeContactSheet seems Deprecated for Adobe Photoshop CS4
image

I suspect that options array is incorrect, because I get this error:

options is an object
https://theiviaxx.github.io/photoshop-docs/Photoshop/ContactSheetOptions.html#contactsheetoptions

@GoGoGadgetGitHub
Copy link
Author

GoGoGadgetGitHub commented Sep 5, 2021

Does that mean it won't be able to work at all? @loonghao

@loonghao
Copy link
Owner

loonghao commented Sep 6, 2021

@GoGoGadgetGitHub
I did some tests and found that only the corresponding window can be triggered, and the corresponding parameters are not effective and executed.
Unfortunately, I don’t have any good solutions for the time being.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants