Skip to main content
Inspiring
February 17, 2016
Answered

Embedding linked graphics

  • February 17, 2016
  • 1 reply
  • 1018 views

Is there any quick way to change a linked graphic to an embedded graphic in FrameMaker? Currently using FrameMaker 10.

    This topic has been closed for replies.
    Correct answer Russ Ward

    You could try the following script, which operates on the currently-active document. Before you do, please note the following:

    - It is generally considered a regressive step to remove file system references from imported graphics. In other words, conventional wisdom would suggest that you are doing damage to your files. I'd recommend backups.

    - I just slapped this script together using general scripting knowledge. I don't make a habit of breaking references. If this thing does something else unexpected, you are on your own.

    Russ

    var counter = 0;
    var graphic = app.ActiveDoc.FirstGraphicInDoc;

       

    while(graphic.ObjectValid())
    {
        if(graphic.constructor.name == "Inset" &&
           graphic.InsetFile != "")
        {
            graphic.GraphicIsSelected = true;
            graphic.InsetFile = "";
            graphic.GraphicIsSelected = false;
            counter++;
        }
      
        graphic = graphic.NextGraphicInDoc;
    }

    alert("Script complete. " + counter + " graphic(s) converted.");

    1 reply

    Legend
    February 17, 2016

    I'm not sure if there is a good way through the GUI. But it is very simple with a script. If you open the ExtendScript editor (File > Script > New Script), you could convert the currently-selected graphic by executing this single line:

    app.ActiveDoc.FirstSelectedGraphicInDoc.InsetFile = "";

    With a few more lines, the script could be enhanced to convert all graphics in the document.

    Russ

    tom_dirksAuthor
    Inspiring
    February 17, 2016

    Thank you Russ. It sounds promising. I have no experience with the script editor, so could you let me know where I could find information on what extra lines would be needed to convert all graphics in the document. There are over one hundred small images that I want to change from linked to embedded.

    Russ WardCorrect answer
    Legend
    February 17, 2016

    You could try the following script, which operates on the currently-active document. Before you do, please note the following:

    - It is generally considered a regressive step to remove file system references from imported graphics. In other words, conventional wisdom would suggest that you are doing damage to your files. I'd recommend backups.

    - I just slapped this script together using general scripting knowledge. I don't make a habit of breaking references. If this thing does something else unexpected, you are on your own.

    Russ

    var counter = 0;
    var graphic = app.ActiveDoc.FirstGraphicInDoc;

       

    while(graphic.ObjectValid())
    {
        if(graphic.constructor.name == "Inset" &&
           graphic.InsetFile != "")
        {
            graphic.GraphicIsSelected = true;
            graphic.InsetFile = "";
            graphic.GraphicIsSelected = false;
            counter++;
        }
      
        graphic = graphic.NextGraphicInDoc;
    }

    alert("Script complete. " + counter + " graphic(s) converted.");