Highlighted

Embedding linked graphics

Community Beginner ,
Feb 16, 2016

Copy link to clipboard

Copied

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

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.");

Views

490

Likes

Translate

Translate

Report

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

Embedding linked graphics

Community Beginner ,
Feb 16, 2016

Copy link to clipboard

Copied

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

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.");

Views

491

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Feb 16, 2016 0
Mentor ,
Feb 17, 2016

Copy link to clipboard

Copied

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

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Feb 17, 2016 1
Community Beginner ,
Feb 17, 2016

Copy link to clipboard

Copied

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.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Feb 17, 2016 0
Mentor ,
Feb 17, 2016

Copy link to clipboard

Copied

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.");

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Feb 17, 2016 0
Mentor ,
Feb 17, 2016

Copy link to clipboard

Copied

I really hate this forum interface. It does the dumbest stuff sometimes. I try to paste in ASCII text and get a table. Here is another try:

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.");

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Feb 17, 2016 0
Community Beginner ,
Feb 17, 2016

Copy link to clipboard

Copied

Thanks so much Russ. The script worked great. Some of the documents actually had over 1000 graphics, so it was a great timesaver.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Feb 17, 2016 0
Most Valuable Participant ,
Feb 17, 2016

Copy link to clipboard

Copied

Russ,

The way to paste code using the Forum web interface is to first click on the HTML button of the editor bar, paste the code and then surround your code with <pre> </pre> tags. [Clumsy, but that's the way Jive's set this stuff up].

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Feb 17, 2016 0