• Javascript to embed ALL linked images into the AI file via script (bug?)
Hello -
I "copy-paste" a couple of different snippet of code to embed all linked images into the AI file.
Apparently it works for a couple of them but for some other, they jumps/moves of position before they are embed…
What happen?
Is that a know "bug"?
I found this on the net -> https://graphicdesign.stackexchange.com/questions/119214/illustrator-javascript-to-embed-linked-images
Hereunder some snippet of code I have tried:
if ( app.documents.length > 0 ) {
while ( app.activeDocument.placedItems.length > 0 ) {
placedArt = app.activeDocument.placedItems[0];
placedArt.embed();
}
}
Another
- #target illustrator
- embedAllImages();
- function embedAllImages(){
- var placedArt = app.activeDocument.placedItems;
- if ( placedArt.length == 0 ) { return; }
- for ( var i = placedArt.length-1; i >= 0; i-- ) {
- placedArt.embed();
- };
- };
Thank you
- Dimitri
