1 Reply Latest reply: Jun 30, 2014 10:15 AM by Hallgrimur Bjornsson RSS

    Deliver .jsx files over HTTP?

    jingtaotan Community Member

      Hello fellow developers,

       

      I am currently looking into developing an Premiere Pro panel which is powered by a web framework such as ASP.NET MVC. The idea is to have the logic and view all running on the server-end, and delivered to an IFRAME in the panel.

       

      I was wondering if it is possible to deliver the .jsx files needed to tell Premiere Pro directly to do things, e.g. add a video to the project bin. From my own research, I have gathered that this is somewhat impossible as CEP only seems to load JSX files from the local filesystem.

       

      For example, if my extension was called FunkyPanel, and in my manifest file I specified ./FunkyPanel.jsx as my <ScriptPath>

       

      in FunkyPanel.jsx I have:

      $._ext = {

          //Evaluate a file and catch the exception.

          evalFile : function(path) {

              try {

                  $.evalFile(path);

              } catch (e) {alert("Exception:" + e);}

          },

          // Evaluate all the files in the given folder

          evalFiles: function(jsxFolderPath) {

              var folder = new Folder(jsxFolderPath);

              if (folder.exists) {

                  var jsxFiles = folder.getFiles("*.jsx");

                  for (var i = 0; i < jsxFiles.length; i++) {

                      var jsxFile = jsxFiles[i];

                      $._ext.evalFile(jsxFile);

                  }

              }

          }

      };

       

      If I were to do in a normal .js file:

       

      csInterface.evalScript('$._ext.evalFile("http://somewhere.com/RemoteScript.jsx")');

       

      The functions declared in RemoteScript.jsx aren't callable.

       

      Has someone had similar experience with this? Could someone confirm if I am heading in the right direction to believe that loading JSX over HTTP is not possible, or it is possible using some other way?

       

      Thanks.

        • 1. Re: Deliver .jsx files over HTTP?
          Hallgrimur Bjornsson Adobe Employee

          Hi,

           

          What you need to do is to make an ajax request which fetches the ExtendScript/JSX code, then eval the ExtendScript code in the extension (as a string, not as a file)

           

          Best regards,

          Hallgrimur

          --

          Hallgrimur Th. Bjornsson | CCE Product Manager - Enterprise  Dashboard - Extensibility| Adobe | Tel: +44 (0) 1314582787