Quantcast
Channel: Adobe Community : Popular Discussions - Illustrator Scripting
Viewing all articles
Browse latest Browse all 12845

Javascript for Illustrator : Copy a document on another specific document issue

$
0
0

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[i]);

     var doc = app.activeDocument;

     for (i = 0; i < doc.pageItems.length; i++) {

                doc.pageItems[i].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


Viewing all articles
Browse latest Browse all 12845

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>