0

Execute photoshop jsx script in tank photoshop publish app

Hi

Has anybody managed to execute a photoshop jsx script while publishing via the tank photoshop publish app?

I have tried executing the following in a hook

try:
    subprocess.check_call(["C:\Program Files\Adobe\Adobe Photoshop CS6 (64 Bit)\Photoshop.exe", <jsx script>])
except:
    pass

 

But it seems to execute after the publish to shotgun has completed. I am executing pass statement in the exception handler since photoshop exits with a non zero exit status(which leads to a CalledProcessError exception) even when there were no errors while executing the jsx script. 

Thanks in advance.

 

Cheers

Samsher

1 comment

  • 0
    Avatar
    Rob Blau

    Hi there Samsher,

    I've tried a couple of approaches to this, but unfortunately I have not found a clean way to run javascript from actionscript unless the javascript file is included in the extension that is running the code.  The closest I've found is if you are able to record the running of the script as an action, then you could use this call to run that action:

    http://cssdk.host.adobe.com/sdk/1.0/docs/WebHelp/references/csawlib/com/adobe/photoshop/Application.html#doAction()

    If this is something that needs to be distributed, then you can put the main logic from the jsx into a library in a shared location and source it from a stub in the Photoshop scripts directory.  Export the recorded action as an Action Set and then load that .atn file up where needed.  Making changes to the stub would require a change on every machine, but changes to the library could be pushed out from a central location.

    That feels somewhat convoluted, but might work for you.

    -r

Please sign in to leave a comment.