• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Calling Action using Node.js

New Here ,
Mar 26, 2017 Mar 26, 2017

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!

TOPICS
Actions and scripting

Views

2.7K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
Community Expert ,
Mar 26, 2017 Mar 26, 2017

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!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Mar 27, 2017 Mar 27, 2017

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)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 27, 2017 Mar 27, 2017

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Mar 27, 2017 Mar 27, 2017

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 27, 2017 Mar 27, 2017

Copy link to clipboard

Copied

LATEST

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines