0

I'm trying to write a short script that takes a screen shot, opens up Photoshop, opens a new file, pastes the screen shot, names it and exports that as a specific file type, in this case png.

I can get it to open up Photoshop using the win32com.client module and the win32com.client.Dispatch function, and I could use the keyboard mod to simulate pressing Ctrl + N to open a new empty file but I don't know how to program the rest of the steps involved in the process like hitting the "Ok" button and exporting the file as some of these other steps don't have any hot keys in PS. I haven't found too much information on the web about using python with PS or other programs that's too relevant to this script. Can any one point me to some helpful resources? Thanks.

I'm trying to stay away from using mouse movement simulation and I don't want to set up a virtual operating system like was talked about in the link below. I'm on Photoshop 2015.

Using python to automate external program

Emilio
  • 11
  • 3
  • 1
    this looks like XY problem. Why would you need Photoshop for this at all? – buran Sep 19 '20 at 11:38
  • I'm not familiar with XY. Photoshop is just my preferred image editing software. – Emilio Sep 19 '20 at 12:22
  • 1
    [XY problem](https://en.wikipedia.org/wiki/XY_problem). You don't need to interact with Photoshop - just take a screenshot in Python and save as png - there are number of possible solutions, e.g. https://pypi.org/project/pyscreenshot/ – buran Sep 19 '20 at 12:29

0 Answers0