1 Reply Latest reply on May 20, 2017 3:03 AM by oliverIntergrafika

    Connection other file Java script from file Java script

    AndreyLarush Level 1

      Hi all

      I decided to make part of the logic in a separate file (xmlData.js on pict.), as this functions will be used in multiple files (hotp.js, tools.js), called from main . How do I do this ?

      QIP Shot - Screen 004.png

       

        • 1. Re: Connection other file Java script from file Java script
          oliverIntergrafika Level 2

          Put Your sub-script before the main .js in .html.

          <script src = "hotp.js"></script>
          <script src = "tools.js"></script>
          <script src = "xmlData.js"></script>
          


          Or if You are using NodeJS in Your panel just require them from xmlData.js

          require( './hotp' );
          require( './tools' );
          


          I am a bit confused why do You load .js with loadJSX. .js files are used to be html panel code, .jsx files are Photoshop Extensdcript.

           

          If You want to load a .jsx to PS virtual machine from HTML panel, use:

          csInterface.evalScript( '$.evalFile( "my.jsx" )', callback );
          

           

          From PS ToolVM load the sub .jsxs with:

          #include 'my.jsx';