Can Adobe .jsx scripts include other script files?

前端 未结 4 1197
猫巷女王i
猫巷女王i 2021-01-06 10:46

We\'re writing a bunch of .jsx scripts and in each I have to mock out some functions so I can use things like Array.map() and String.trim(), but I don\'t want to have to inc

4条回答
  •  心在旅途
    2021-01-06 11:19

    Just leaving this here for anyone like me who is looking for this. In Adobe Illustrator CC 2015, I was unable to get #include to work, but @include did. So for example:

    External File: foo.jsx

    function alertTheWordNo(){
      alert('NO');
    }
    

    The Script File: bar.jsx

    //@include 'foo.jsx';
    alertTheWordNo();
    

    Disclaimer: I cannot find any documentation of this but have tested it with Adobe Illustrator CC 2015 and it works.

    Hope this helps someone. If anyone has any questions just ask!

提交回复
热议问题