Wednesday, August 08, 2007

CS3 and Script Chaining

I've been playing with the new JS engine in Illustrator CS3, and it is now possible to import script libraries. Incidentally, this also allows one to chain scripts using the following syntax:

//Customize the following line to reference a library script from your main Illustrator script directory: (note you can select multiple sources by separating with a semicolon.)

#includepath "../../../presets/scripts/myLib;../../../../presets/scripts/myLib"
#include "script1.js"
#include "script2.js"
#include "script3.js"
//put your custom code here:
alert("ta-da!!!");

I will be writing more modular scripts soon to take advantage of this.
I'm looking forward to seeing what people do with this. Now if only we can get those actions to stay linked...