I need to close all Photoshop documents, be it any number, without saving and without any user prompt. My current code is below for closing the active document only.
psApp = win32com.client.Dispatch("Photoshop.Application")
psApp.Application.ActiveDocument.Close(2) # close file without saving
psApp.Quit()
Photoshops API documentation is terrible, but here’s what I’ve attempted for closing all:
while psApp.documents.length:
psApp.activeDocument.close()
AttributeError: <unknown>.length
Any help is very much appreciated!
2
Answers
Try this:
I dont have PS, but I can confirm it works with Word!
I can close all active documents with this.