Copy link to clipboard
Copied
Hi,
I have an action that I've created in photoshop. I'd like to automate the process of running this action. I've done this in the past in C# using the Photoshop driver. I've abandoned C# for Node.js and would like to learn how to do this in Node.js.
Any help would be greatly appreciated!
Copy link to clipboard
Copied
Not sure about node.js – however with regular javascript/extendscript the line of code would be:
app.doAction("My Action","My Action Set.atn")
Hope this helps!
Copy link to clipboard
Copied
Hi,
Fist convert your action to .jsx.
If You are using standalone Node or PS's built in one, use generator to send JSXs to Photoshop: generator-core
Check out the
Generator.prototype.evaluateJSXString = function (s)
If You are in a HTML panel and node is enabled with
<Parameter>--enable-nodejs</Parameter>
<Parameter>--mixed-context</Parameter>
You can simply used CSInterface-x.y.0.js 's
CSInterface.prototype.evalScript = function(script, callback)
Copy link to clipboard
Copied
Thanks for the approach.
I'm not sure how to convert actions .atn to .jsx
Is there a link for showing how to do this?
I couldn't find anything online.
Copy link to clipboard
Copied
You either just call the action, as shown above, using the doAction() method, or you note step by step of the action, and repeat them manually while the ScriptListener plug-in is active. Then you take its output and clean it up and turn it into a function.
A trick, which did help me a lot with cleaning up is to open the ScriptListener log in the ExtendScript Toolkit, and let it display its update after each and every step you do, and note the desc number of the last step.
Copy link to clipboard
Copied
Another option is xbytor’s xtools:
ps-scripts - Browse /xtools/v2.3 at SourceForge.net
https://www.ps-scripts.com/viewforum.php?f=53
ActionFileToJavascript.jsx
ActionToJavascript.jsx