win32com with Photoshop

Grant Foster me at grantfoster.com
Mon Dec 9 08:06:23 EST 2002


Hi there

I am trying to automate Photoshop actions on a number of files. If I run the
following code interactively from a python prompt, everything works as it
should and the result (res) is -1. If I then run the script from a file,
Photoshop and the file is opened and then closed again, but the action is
not run and res is 0. Can anyone help?

from win32com.client import Dispatch

psapp = Dispatch("Photoshop.Application")
psapp.Open("C:\JS1.jpg")
res = psapp.PlayAction("test1")
psapp = None
print res


TIA

Grant Foster
me at grantfoster.com





More information about the Python-list mailing list