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.
Copy link to clipboard
Copied
Moving to the FrameMaker forum from Get Started
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
Copy link to clipboard
Copied
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.
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.
Copy link to clipboard
Copied
Is it possible to read pgadmin (PostgreSQL) database table using extendscript? Please suggests if any ideas.
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.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
Take care of your xrefs, if there are any!