Since the ExtendScript layer is much older and slower than the JavaScript layer, it's typically best to accomplish as much as possible in the JavaScript layer and only call commands in the ExtendScript layer when absolutely necessary. If you need to include external code libraries, they must be compatible with ES3 JavaScript. Nevertheless, most of the core JavaScript components remain intact, plus some additional global objects specific to each individual host Adobe application such as the $ object, app object, and more. This means the latest ES6 features such as arrow functions, the const and let keywords, modern array functions, and more are not available. Just like in standard Adobe scripting, ExtendScript is Adobe's custom flavor of JavaScript, which is based off of the much older ES3 version of JavaScript (released in 1999). In order for CEP Extensions to get information or send commands to the host application, such as After Effects or Premiere Pro, they must call functions in the ExtendScript layer. While this JavaScript layer of CEP is up-to-date and flexible to use, unfortunately when it comes to communicating with the host application, ExtendScript is still needed. Node.js also has the ability communicate with external processes, including useful command line applications like FFMPEG and others. This greatly optimizes development time as there are libraries for practically every common task in existence. The CEP backend runs on Node.js, a powerful JavaScript runtime that comes with built-in modules providing most common functions needed by desktop apps, and an enormous online community-driven npm library for everything else. Also, modern JavaScript allows for complex communication systems between local or remote processes through HTTPS, WebSockets, and other protocols not possible with standard scripting. This greatly improves development time and the available resources over the much more primitive Script UI found in Adobe scripts. Modern ES6 JavaScript allows for the use of common frameworks for developing reliable, state-driven user interfaces including React, Vue, and Svelte. The CEP frontend uses the same HTML + CSS + JS combination used in web development. This means that the UI frontend has direct access to the Node.js backend in the same environment. The CEP JavaScript Layer is Chromium (essentially a Chrome web browser) for the frontend and Node.js on the backend combined into the same runtime, based off of the model by NW.js. However the modern JavaScript frontend with Node.js opens up a whole new world of possibilities. Like scripts, extensions can be used to manipulate layers, set properties, import footage, read data from files, execute renders, automate menu clicks, and so much more. Extensions, or CEP Panels, are the most powerful and flexible way to automate and optimize various tasks in Adobe apps and can be used to build beautiful complex UIs, handle complex state management, and communicate with external processes and over the internet in fast robust methods.
0 Comments
Leave a Reply. |