• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

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

Community Beginner ,
Oct 16, 2019 Oct 16, 2019

Copy link to clipboard

Copied

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.

TOPICS
Scripting

Views

931

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
community guidelines
Guest
Oct 17, 2019 Oct 17, 2019

Copy link to clipboard

Copied

Moving to the FrameMaker forum from Get Started

Votes

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
community guidelines
Mentor ,
Oct 17, 2019 Oct 17, 2019

Copy link to clipboard

Copied

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

Votes

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
community guidelines
Community Beginner ,
Oct 18, 2019 Oct 18, 2019

Copy link to clipboard

Copied

I have used this code. Thank You.

Votes

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
community guidelines
Community Beginner ,
Oct 28, 2019 Oct 28, 2019

Copy link to clipboard

Copied

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.

Votes

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
community guidelines
Mentor ,
Oct 29, 2019 Oct 29, 2019

Copy link to clipboard

Copied

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.

Votes

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
community guidelines
Community Beginner ,
Oct 30, 2019 Oct 30, 2019

Copy link to clipboard

Copied

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

Votes

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
community guidelines
Mentor ,
Oct 30, 2019 Oct 30, 2019

Copy link to clipboard

Copied

I certainly cannot answer that question with any precise answer. I am sure that if the database has an API, then it is possible. Especially if it is an HTTP rest API. But I don't know anything about that database.

Votes

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
community guidelines
Community Expert ,
Oct 30, 2019 Oct 30, 2019

Copy link to clipboard

Copied

LATEST

The way I am handling databases now is getting xml dumps and then processing the xml with ExtendScript. It is an extra step in the process, but most database admins are able to easily supply me with xml from their database.

Votes

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
community guidelines
Enthusiast ,
Oct 29, 2019 Oct 29, 2019

Copy link to clipboard

Copied

Take care of your xrefs, if there are any!

Votes

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
community guidelines