Welcome Dialog

Welcome to the Community!

We have a brand new look! Take a tour with us and explore the latest updates on Adobe Support Community.


Photoshop API: Execute Action: Custom (JS) Script ?

New Here ,
Nov 02, 2021 Nov 02, 2021

Copy link to clipboard

Copied

Hello! I'm wondering if it's possible to use the Photoshop API to do the following:

 

1. create new file/artboard at specific resolution

2. run a custom Photoshop script written in Javascript

3. (save output as PNG to my node server)

 

I see the API reference has an Execute Action post method but I'm not clear how I would setup the action? Would I make my script a photoshop action, export it, and upload it to a cloud service with a public web url?

 

Thanks! 🙂

 

TOPICS
Actions and scripting, SDK

Views

41

Likes

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 Professional ,
Nov 02, 2021 Nov 02, 2021

Copy link to clipboard

Copied

LATEST

I'm not sure about the API, however, one can call a JavaScript from a JavaScript. No need to put the script call into a doAction.

 

 

// GUI
(function () {
    var selectJSX = File.openDialog("Select a JSX file to open", "Select:*.jsx");
    if (selectJSX === null) return;
    var cleanJSXpath = selectJSX.fsName.toString();
    $.evalFile(File(cleanJSXpath));
}());

// or

// No GUI
$.evalFile(File('~/Desktop/myScript.jsx'));

 

 

 

Likes

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