Hey all.

I'm trying to write a script to help automate some output for adobe illustrator cS3



the workflow i have so far is

1 open AI
2 open the file.ai
3 open the variable library.xml
4 load the dataset from the library
5 rotate the file 90 degrees
6 output file as eps
7 output file as Flash
8 close ai


1) im not sure if its possible to have a js file open and then comunicate with AI or if i just have to open the file natively from AI.

2) i can load the variable library but i am having trouble with step 4 that i cant seem to get it to load the documents with the dataset from the library i load. to do this manually from the "variables" window i just load new variable library then set the dataset to "robert" (the name of the dataset)

4) For whatever reason i can not get this thing to rotate the document before it comes out.

The code i have now is

Code:
//var myDoc = app.open(File("/c/Documents and Settings/rbarbrow/desktop/AI project/NCAA_mens_small.ai"));
var myDoc = app.open(File("NCAA_mens_Final.ai"));
//Opens xml data file
//myDoc.importVariables(File("/c/Documents and Settings/rbarbrow/desktop/AI project/BracketTest3.xml"));
myDoc.importVariables(File("BracketTest3.xml"));
//crap delete later

alert("hi")
//optional rotate ( leave out of script if not needed)
myDoc.layers[0].rotate = 90

exportFileAsEPS("test.eps")
 exportToFlashFile("testflash.swf")

but thats doesnt seem to work

I also tried
myDoc.rotate = 90 and even thought it doesnt throw an error it doesnt do anythign.


Thanks if you can help