Skip to main content
Participating Frequently
October 17, 2019
Question

Get the paragraph in page by page from framemaker using script ?

  • October 17, 2019
  • 5 replies
  • 1254 views

hi,

    I have used below code for count the paragraph from  framemaker.

function CountPgfs(doc) {
var pgf, paragraphCount = 0;
pgf = doc.FirstPgfInDoc;
while (pgf.ObjectValid() === 1) {
paragraphCount += 1;
pgf = pgf.NextPgfInDoc;
}
return paragraphCount;
}

 

This code display paragraph count for whole framemaker document  including masterpage ,referencepage and bodypage.But i need to display the paragraph  count in page by page like only bodypage paragraph using framemaker script.Please suggests if any ideas.

This topic has been closed for replies.

5 replies

Klaus Göbel
Legend
October 29, 2019

Take care of your xrefs, if there are any!

Participating Frequently
October 29, 2019

How to split Framemaker document? If 10 pages of framemaker document split  like 1-5 pages in  first document and 6-10 pages in second document using framemaker scripting.Please Suggests if any ideas.

Legend
October 29, 2019

I think you would just delete pages 6-10, then do a Save() with parameters to make it a "save as". Then reopen the original document and do the same for pages 1-5. There are a number of variables involved here and your requirements are somewhat vague... so that's the most I can suggest for now.

Participating Frequently
October 30, 2019

Is it possible to read pgadmin (PostgreSQL) database table using extendscript? Please suggests if any ideas.

Participating Frequently
October 18, 2019
I have used this code. Thank You.
Legend
October 17, 2019

Hi,

 Here is a quick little function to get the page type for a paragraph. It returns a string, one of "BodyPage", "MasterPage", "RefPage", or "HiddenPage". It's not the way I would put the code together, but it should at least give you an idea how to do it. Hope this helps.

 

function getPgfPageType(doc, pgf)
{
  var pageType = "";
  var frame = pgf.InTextFrame;
  var pageFrame = null;
   
  while(frame.ObjectValid())
  {
     pageFrame = frame;
     frame = frame.FrameParent;
  }
  if(pageFrame)
  {
     var page = pageFrame.PageFramePage;
     var pageType = page.constructor.name;
  }
    
  return pageType;    
}

 

Russ

October 17, 2019

Moving to the FrameMaker forum from Get Started