Javascript is just one of three scripting languages which Illustrator supports.
There's also Visual Basic for Applications (VBA) and AppleScript.
This is one area in which Illustrator has an edge over competing mainstream drawing progams.
Scripting Support in Mainstream Drawing Programs
| Javascript | Visual Basic | Applescript |
| Adobe Illustrator | Yes | Yes | Yes |
| Adobe FreeHand | No | No | No |
| Corel Draw | No | Yes | No |
| Deneba Canvas | No | Yes | No |
So how does an illustrator who never foresaw himself getting into the minutia of writing code decide
which language to invest time in learning? Everyone has his/her own reasons. Here are the considerations
that most affected me.
Cross Platform
VBA is for Windows. AppleScript is for Mac OS. Javascript is for both. When looking for reasons,
especially from inside the graphics community, that's a pretty strong one. Write an Illustrator
Javascript on your Mac, share it with your Windows-using Illustrator buds.
(I'm on Windows, by the way.)
Web Ubiquity
If it's not Microsoft-proprietary like VBA, and it's not Apple-proprietary like AppleScript,
Where did Javascript come from? From
Netscape.
Javascript is the primary client-side scripting language for web browsers, able to make web pages leap tall
buildings in a single bound and able to make your computer act smarter than a dumb text terminal.
Just imagine! With Javascript, your modern computer with its multi-gigabyte memory, multi-terabyte hard disk,
and multi-gigaflop cpu can use its super powers to do a little local processing while viewing web pages. What a concept!
Being so wide spread a web standard as to be practically (if not technically) open source, books, websites,
and even free scripts abound. Knowing a little Javascript for one thing means knowing a little Javascript
for alot of things. To wit...:
ActionScript
Monkeying around in Macromedia Flash was actually my first exposure to scripting. When monkeying around with Flash,
even the thickest-skulled primate eventually figures out that the real power to do very cool things lies not in the
flipbook-like frame-by-frame animation features, but in the interactive "smarts" made possible by what was then
called FlashScript. Guess what? FlashScript (now called ActionScript) was based on Javascript.
So when this monkey finally noticed that Illustrator had acquired a Javascript "engine" this monkey may have been
hanging by a mere twig, but had at least an admittedly tenuous grasp on something.
Well, it works both ways. The time you invest in getting familiar with AI Javascript will also pay dividends
in Flash. Sure, the objects, methods, and properties are different (as they are in Acrobat, Photoshop, and InDesign),
but the concept and syntax is much the same.
So Illustrator is a vector drawing program gaining affinity for Flash (now that Adobe owns them both),
and Flash vectorizes the web, and one of the most ubiquitous and versatile web-centric languages is Javascript.
You do the math.