how to change "activeDocument"?
Hi Guys, I am new to Illustrator scripting - actually just started today. I don't know how to change the activeDocument to recursively process all the open .ai files and generate corresponding PNG files. "documents" is an array of all open .ai files. My problem is that all the generated PNG files are the same. The alert message confirms that activeDocumen.name doesn't change, whereas the sourceDoc name recurrsively changes based on the open files.
Here is a code snipit:
for ( i = 0; i < app.documents.length; i++ ) {
sourceDoc = app.documents; // returns the document object
// Get the file to save the document as pdf into
targetFile = this.getTargetFile(sourceDoc.name, '.png', destFolder);
// Export as png
sourceDoc.exportFile(targetFile, ExportType.PNG24, options);
alert (activeDocument.name);
alert (sourceDoc.name);
}Any help is appreciated!
Alex