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

CheckBox Data (Togel Switch) send to JSX function

Explorer ,
Jul 01, 2021 Jul 01, 2021

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);
};
 
 
when i use alert function in JSX then it shows me a true or false as it should be! But when i run the function it is always true! 
you can download the whole code, but you should change the format to JS and JSX! bcz i could not upload it hear!
TOPICS
Scripting , SDK

Views

279

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
LEGEND ,
Jul 01, 2021 Jul 01, 2021

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

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
Explorer ,
Jul 02, 2021 Jul 02, 2021

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

 

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
Explorer ,
Jul 02, 2021 Jul 02, 2021

Copy link to clipboard

Copied

Here I record the problem to show it better : https://youtu.be/yxc06epxzMs

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 ,
Jul 04, 2021 Jul 04, 2021

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)

Mathias Möhl - Developer of tools like BeatEdit and Automation Blocks for Premiere Pro and After Effects

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
Explorer ,
Jul 05, 2021 Jul 05, 2021

Copy link to clipboard

Copied

LATEST

thank you very much for your answer. that was exactly the problem.

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