javascriptadobeadobe-scriptui

Is there a way to import functions from an external file when scripting in Adobe Illustrator (JSX)?


I am writing a script that contains many functions. Ideally I would like these functions to be stored in utils.js file. And the main.js would import these functions from there and use them. The problem is that the standard javascript methods can not be used, since Adobe scripting uses a simplified version an some of the methods are not implemented.

So what is the way to call functions from an external file in Adobe scripting?


Solution

  • Finally I have found an answer to that, if anyone else has this problem, use:

    #include "script.js";
    

    and simply use the functions defined in the script.js file :) Thanks to the guys from Adobe Forum!