Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

How to embed multiple images

New Here ,
Sep 27, 2012 Sep 27, 2012

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?

TOPICS
Scripting
9.7K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Mentor , Sep 28, 2012 Sep 28, 2012

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();

    };

};

Translate
Adobe
Community Beginner ,
Sep 27, 2012 Sep 27, 2012

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();

    }

}

}

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 27, 2012 Sep 27, 2012

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?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Mentor ,
Sep 28, 2012 Sep 28, 2012

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();

    };

};

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 28, 2012 Sep 28, 2012

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?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Mentor ,
Sep 28, 2012 Sep 28, 2012

Well you could confirm this issue by telling us what CS version & OS your using…?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 28, 2012 Sep 28, 2012

I'm running a CS5 on XP pro

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Mentor ,
Sep 28, 2012 Sep 28, 2012

Oh well there goes the CS6 or Lion problem…

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Sep 28, 2012 Sep 28, 2012

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?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Sep 28, 2012 Sep 28, 2012
LATEST

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines