2 Replies Latest reply on Mar 3, 2017 8:37 AM by funsekon

    Importing graphic into graphics frame on a Reference page


      Hello All,

      Need to import a graphic (by copy) into a graphics frame located on a Reference page of the document. The objective is to have a number for each chapter on the First Master Page. This is done by using 'Frame Above Pgf' of the Paragraph Tag. This works fine manually, as shown below. I would like to have a generic chapter FM file where I can change the chapter number according to the value of <$chapnum>.

      Is there a way to import the graphic (number) into the graphics frame? I see Import, but it requires a TextLoc that I don't have.

      Any help is greatly appreciated.



      #target framemaker
      var oDoc, oPage, oFrame, oGfx;
      var oDoc = app.ActiveDoc;
      if (oDoc.ObjectValid()){
          oPage = oDoc.FirstRefPageInDoc;
          while (oPage.ObjectValid()) {
              oFrame = oPage.PageFrame;
              if(oPage.Name == 'Reference Page 2'){
                  oGfx = oFrame.FirstGraphicInFrame;
                      while (oGfx.ObjectValid()){
                          if (oGfx.constructor.name == 'UnanchoredFrame'){
                      oGfx = oGfx.NextGraphicInFrame;
              oPage = oPage.PageNext;