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! 🙂
Copy link to clipboard
Copied
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'));