This unfortunately does not work anymore for the new DOM API Version 2. What do we have to change to make it work with the DOM API Version 2?
I donât think you can make it work. From what I can tell, UXP no longer supports running old JSX scripts at all. Even if you try to play an action through UXP where the action runs a JSX script, that will not work either. So the only option is to recreate the script in UXP.
JSX is deprecated and is on the way out eventually. I think this is just part of the JSX phase out process.
I agree but for me Export is not available and textItem is still not available.
do we even have a batchplay script that can export to a specific file lname and location?
nothing AFAIK, this is intentional to discourage devs from relaying on JSX and for âsecurityâ reasons. I wouldnât mind that change if UXP was more complete and stable. but we can only adapt at this point.
I canât quickly find now who suggested this, but I think it was somewhere here in the forum
You could try a workaround (which still worked in July on Ps v23.4.1, but keep in mind, if it will work now, it might stop at any time in the future):
- Create an action, that executes your JSX script (lets name it âAction 1â)
- Create an action, that plays previously created âAction 1â (lets name it âAction 2â)
- Run âAction 2â from UXP
So basically you should run an action, which plays another action, which has a JSX script I assume Adobe somehow overlooked it and this will be fixed (if not yet) at some point.
LOL⌠nested actions for a work around.
I think Adobe has been clear enough that they donât want JSX being ran from UXP.
As far as Iâm concerned, JSX is an ancient fossil buried in the CS6 sediment layer. I have no desire to dig up the bones.
If anybody finds a solution (that is to say, something that hasnât been guard-railed by Adobe yet), they better not post it here but keep it secret instead
Old JSXâs fate is sealed
Have you changed the modal behaviour? Otherwise delete that line - still works for me API 2
Iâm trying to get this script to work,
i created a folder with name jsx in the panel folder
and inside I put a file named script1.jsx
but it does not work,
can anyone see whats wrong and where i went wrong?
this is the script
async function test1() {
await ScriptRun(script)
var script = "jsx/script1.jsx"
const app = window.require("photoshop").app;
const { entrypoints } = require("uxp");
const batchPlay = require("photoshop").action.batchPlay;
const fs = require("uxp").storage.localFileSystem;
async function ScriptRun(jsxFile) {
let pluginFolder = await fs.getPluginFolder()
try {
let jsxFileObject = await pluginFolder.getEntry(jsxFile);
var filetoken = await fs.createSessionToken(jsxFileObject);
} catch (e) {
app.showAlert("No Script");
}
return await batchPlay(
[
{
"_obj": "AdobeScriptAutomation Scripts",
"javaScript": {
"_path": filetoken,
"_kind": "local"
},
"javaScriptMessage": "JSM",
"_isCommand": true,
"_options": {
"dialogOptions": "dontDisplay"
}
}
], {
"synchronousExecution": false,
"modalBehavior": "fail"
});
}
As Davide suggested⌠Adobe does its best to not make JSX execution from UXP possible.
Jarda
unfortunately I have many jsx scripts and reviewing them all in uxp will be torture,
iâm not quite ready to embrace uxp.
Is there a solution to my problem right now?
There are some tools to convert action manager code into batchPlay. There is also new DOM that somewhat tries to be similar to old ExtendScript DOM. But nothing automatic so far.
Did you try my suggestion? Or doesnât it work any more? In any case, sooner or later you will have to move to UXP
Excuse me I have tried the above suggestions but they donât work. I put my example above, whatâs wrong? I know weâll switch to uxp but right now I donât have much time to study all the documentation.
I have no idea what youâre saying. This is English speaking forum