Scripts I've written to automate Illustrator with Scriptographer - http://scriptographer.org/