Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>We're now using the <code>$</code> helper available in Illustrator, and the <code>$.evalFile()</code> method. Pass it a path and it will evaluate the file and return the result.</p> <p>I created a little helper that I can include (minified, of course) at the top of my .jsx scripts so I can do <code>Libraries.include("my-other-script")</code> that will include, in my case, a file that's in my <code>adobe_scripts</code> root folder, in a directory called <code>lib</code>.</p> <pre><code>// indexOf polyfill from https://gist.github.com/atk/1034425 [].indexOf||(Array.prototype.indexOf=function(a,b,c){for(c=this.length,b=(c+~~b)%c;b&lt;c&amp;&amp;(!(b in this)||this[b]!==a);b++);return b^c?b:-1;}); var Libraries = (function (libPath) { return { include: function (path) { if (!path.match(/\.jsx$/i)) { path = path + ".jsx"; } return $.evalFile(libPath + path); } }; })($.fileName.split("/").splice(0, $.fileName.split("/").indexOf("adobe_scripts") + 1).join("/") + "/lib/"); </code></pre> <p>Minified version that I include:</p> <pre><code>/** * Libraries.include(path) -- path must be relative to adobe_scripts/lib/ * See: https://gist.github.com/jasonrhodes/5286526 */ [].indexOf||(Array.prototype.indexOf=function(a,b,c){for(c=this.length,b=(c+~~b)%c;b&lt;c&amp;&amp;(!(b in this)||this[b]!==a);b++);return b^c?b:-1;});var Libraries=function(a){return{include:function(b){return b.match(/\.jsx$/i)||(b+=".jsx"),$.evalFile(a+b)}}}($.fileName.split("/").splice(0,$.fileName.split("/").indexOf("adobe_scripts")+1).join("/")+"/lib/"); </code></pre> <p>See gist here: <a href="https://gist.github.com/jasonrhodes/5286526" rel="nofollow">https://gist.github.com/jasonrhodes/5286526</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload