Copy link to clipboard
Copied
I am trying to send a very simple Boolean (true/false) from JS to JSX! But it doesn't work!
Hier is the code in JS. ( in JS everything work perfect!)
var RenderTogelSwitch = document.getElementById("RenderStart_True_False");
then:
if (RenderTogelSwitch.checked) {
csInterface.evalScript("Export(' " + rootfolder + " ',' " + true + " ')");
} else {
csInterface.evalScript("Export(' " + rootfolder + " ',' " +false+ " ')");
};
this is the function in JSX.
function Export(rootfolder,Render){
app.project.renderQueue.queueInAME(sofortRender);
};
Copy link to clipboard
Copied
Isn't "Export" a reserved keyword/ UI label? I would have to check it, but I'd suggest you actually use proper variable names that do not reference standard UI code or internal functions. Other than that it might really help to have the actual full code and proper system info. It's quite possible that e.g. your "rootfolder" function simply is unable to work due to permission issues or it may need some different treatment with an URI decode or whatever just like of course there could be any number of other issues. Point in case: The error must not be on those lines you posted, but could simply be some other function not working.
Mylenium
Copy link to clipboard
Copied
Thank you very much for your answer and your time.
Export function and rootfolder are not the problem. They work without any problem.
i will be glad, if u checked the code!
You find the Export function in main.js and queueInAME in mainFunction.
thank a lot.
hier the Dowload link: https://shared-assets.adobe.com/link/b4e61143-55f0-491f-5e60-4b67292771ad
Copy link to clipboard
Copied
Here I record the problem to show it better : https://youtu.be/yxc06epxzMs
Copy link to clipboard
Copied
It seems like you send strings 'true' and 'false' instead of real booleans true and false.
The strings 'true' and 'false' are both converted to the boolean value true (like any other string except the empty string.
Try
csInterface.evalScript("Export(' " + rootfolder + " ',true)");
instead of
csInterface.evalScript("Export(' " + rootfolder + " ',' " + true + " ')");
(and analogously for the second call)
Copy link to clipboard
Copied
thank you very much for your answer. that was exactly the problem.