Javascript for Illustrator : Copy a document on another specific document issue
Hi,
I've managed to select elements on a source file but it fails when copying. The selection should be copied on targetFile.
There is like 5 to 10 files by sourceFolder (there is an error in opening each file but this is not the matter for now - only the first one is openend)
var targetFile = app.documents.add(); //this is my output file - it works
folder = Folder.myDocuments; //this paragraph works for now
sourceFolder = folder.selectDlg("source");
for ( i = 0; i < files.length; i++ ){
var sourceDoc = app.open(files);
var doc = app.activeDocument;
for (i = 0; i < doc.pageItems.length; i++) {
doc.pageItems.selected = true;
}
var mySel = app.activeDocument.selection; //this paragraph need rework
newItem = mySel[0].duplicate(); //mysel.duplicate() is not a function
}
Thanks I copy a document, resize it and place it then I print the output
