Copy link to clipboard
Copied
Hello!
I have been tying to figure out how I could easily embed multiple linked images easily. I have some 1000 .svg images which have about 1-7 .tif images linked in to them. I now need to get those links embedded and becouse of the amount of images I'm hoping to make an action out of it. I have a script to embed single image in .svg but haven't have luck with multiple embeddings.
Any ideas?
The sample is a function it will do nothing until called upon…
#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();
};
};
Copy link to clipboard
Copied
How about use a function like:
function embedAllImages(){
placedArt = app.activeDocument.placedItems;
if (placedArt < 0) {
return;
} else {
for ( var i = placedArt.length-1; i >= 0; i-- ) {
placedArt.embed();
}
}
}
Copy link to clipboard
Copied
Hi!
Couldn't get it to work. It did't seem to do anything when I ran it through. Have You got this working? Can You tell how?
Copy link to clipboard
Copied
The sample is a function it will do nothing until called upon…
#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();
};
};
Copy link to clipboard
Copied
Great got it working now. Thanks for Your help.
BUT (there always seems to be a but) now I'm facing new troubles. Kind of the same that Dovidgold seems to be facing http://forums.adobe.com/message/4733717#4733717
After running the script on a image with two linked items. One of the items jumps on a different layer and scales it self to original size.
So, once again, any ideas?
Copy link to clipboard
Copied
Well you could confirm this issue by telling us what CS version & OS your using…?
Copy link to clipboard
Copied
I'm running a CS5 on XP pro
Copy link to clipboard
Copied
Oh well there goes the CS6 or Lion problem…
Copy link to clipboard
Copied
I see I'm not the only one experienceing the bug.
I have made a screencast (1:22min) demonstrating the bug on a Windows 7 (64bit) using CS6 (64bit).
http://www.youtube.com/watch?v=njToOj0Ly_8
My question is, is this an internal application / compiler bug, or is the syntax incorrect?
Copy link to clipboard
Copied
I'm using a workaround now to embed all linked images when saving, using the save options properties:
var saveOps = new IllustratorSaveOptions();
saveOps.embedLinkedFiles = true;
app.activeDocument.saveAs(File('~/desktop/savedembed.ai'), saveOps);
This is on a mac, ~ means home directory. On windows just use a windows path.
This accomplishes the same thing for what I needed the script for. But may not be the best option for all cases.
I hope a developer for Adobe can answer or solve the bug.
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more