View Full Version : Using DOM in AI JavaScripts - is it possible?

03-31-2009, 03:18 PM
I am using JavaScript in the Adobe Illustrator environment to create and manipulate .svg graphics. I am new to JavaScript - still feeling my way around. It appears that when you are working with a browser that the DOM is automatically populated and available. Is there a way to populate and use the DOM when JavaScript is not being used in web browser applications.

Is there a good tutorial or similar that I can look at for assistance?


rnd me
04-01-2009, 02:18 AM

the dom is normally populated by tags and attribs in the source of the page/file.
that works fine without javascript.

i don't know what else (besides js) you could use to change it though.

there are some java and flash bindings, but i doubt those would work if javascript didn't.

what exactly are you wanting to do?

04-01-2009, 05:52 PM
I have written a JavaScript that is initiated by Adobi Illustrator. Adobi has provided some application specific methods that allows mannipulation of a graphic immage. They also make certain pieces of data available. My script forces some save settings and captures some data about the SVG graphic that the artist is creating. I save that data in a well formed xml document. I want to read that XML document with my script and make changes to it. If I could reference it in the DOM by tag names it would be much easier.

Since there is no browser involved, I'm assuming I need to somehow load/populate the DOM tree before I can reference data. Is this not the case?

Thanks in advance