Skip to main content
Participating Frequently
Oct 17, 2019 6:51 AM UTC
Question

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

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 is closed to new replies. Start a new post to keep the conversation going.

9 replies

Klaus Göbel
Legend
Oct 29, 2019 12:32 PM UTC

Take care of your xrefs, if there are any!

Translate
Participating Frequently
Oct 29, 2019 5:32 AM UTC

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.

Translate
Legend
Oct 29, 2019 12:14 PM UTC

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.

Translate
Participating Frequently
Oct 30, 2019 7:09 AM UTC

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

Translate
Participating Frequently
Oct 18, 2019 7:54 AM UTC
I have used this code. Thank You.
Translate
Legend
Oct 17, 2019 11:50 AM UTC

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

Translate
Oct 17, 2019 7:29 AM UTC

Moving to the FrameMaker forum from Get Started

Translate