So I discovers this really nifty api that allows you to control photoshop with python using win32com. (More info: photoshop-scripting-python!)
What i want my code to do is run a diffrent action on a JPEG depending on the name of the file it's located in. That part will be relativly easy to code out. The problem i run into is whne trying to run the action via python photoshop gives me the following error "The command 'play' is not currently available"
from win32com.client import Dispatch
psApp = Dispatch("Photoshop.Application")
folder = 'C:\\This\\is\\the\\path\\to\\my\\folder'
for root, direc, files in os.walk(folder):
for file in files:
image = os.path.join(root, file)
doc = psApp.Open(image)
psApp.DoAction('Action Folder', 'Action')
Thus far I have tried deleting steps from my action inoreder to determain which step is giveing me the error. Up until the point where all i'm doing is changeing the image size nad it still doesn't work.
Attached is screenshot of my action
Here's to hoping somone knows a thing or to about this api.
Alos I should mention that this error did not occer when running a defuault photoshop action.
Adobe Community Professional, Aug 04, 2021Aug 04, 2021
jazz-y • Adobe Community Professional, Aug 04, 2021Aug 04, 2021
psApp.DoAction('Action Folder', 'Action') ExtendScript DOM uses the reverse order of the arguments. If I understand correctly, then python interacts with the DOM through win32com. psApp.DoAction('Action', 'Action Folder')