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

how to place a copy of a librairie item with a script?

$
0
0

i've created a librairie with 1 graphic.

i can place this item as a embeded copy (only option available in cc 2014), or as a link (new with cc 2015)- just right click and choose the place in context menu.

 

now, how can i do this from script?

 

with this little skeleton from from the reference PDF i get access to the item from librairie in current document = so should be easy to place it as copy ...

 

 

if ( app.documents.length > 0 ) {

var fileReferences = new Array();

var sourceDoc = app.activeDocument;

var sourceName =sourceDoc.name;

 

 

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

artItem = sourceDoc.pageItems[i];

 

    switch ( artItem.typename ) {

        case "PlacedItem":

        fileReferences.push( artItem.file.fsName );

       

       

        break;

}

}

 

fred


Viewing all articles
Browse latest Browse all 12845

Trending Articles



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