Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Calling a second script from within my main script.

  • Calling a second script from within my main script.

    Posted by Fabio Apelbaum on June 3, 2016 at 5:44 pm

    Hi guys! another question!

    I currently have two .jsx files, my main script and another that does an extensive task. My main script creates a UI which has a button that when clicked, it calls the 2nd script and runs it. I found out that I might need to use some of the information generated by my 2nd script to update events that happens in my main script. Is there a way to set/call variables or arrays of my 2nd script from my main script? I really like to void the option of merging the two into one file.

    Currently im calling the 2nd script with the following code:

    importINFO.onClick = function() {
    var file = new File("/VOLpromo/04_SCRIPTS/GUI/GS_Import.jsxbin");
    file.open("r");
    eval(file.read());
    file.close();
    }

    Thanks, any info will be appreciated!!

    Happy friday everyone!

    Fabio

    Miguel De mendoza replied 9 years, 11 months ago 2 Members · 1 Reply
  • 1 Reply
  • Miguel De mendoza

    June 5, 2016 at 9:54 am

    You can use #include statment at the top of the script:

    #include Other_Script_Name.jsx

    Make sure that the script is in the same folder, or in a subforlder:

    #include Subfolder/Other_Script_Name.jsx

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy