Re: How to insert a new paragraph?
Hi Mark, You need to use the NewSeriesPgf method of the document object. Then create a TextLoc on the new pgf and add text. var newPgf = doc.NewSeriesPgf ( oldPgf );var TLoc = new TextLoc ( newPgf, 0...
View ArticleHow to find last Pgf of pasted paragraphs?
I'm pasting several Pgf objects at once into a file (a changes file of sections containing changebars), in the main text flow. I want a divider line to go at the end of each pasted section, so I try to...
View ArticleRe: How to find last Pgf of pasted paragraphs?
Hi Mark, The problem is that the paste is not occurring where you think. The divider line is being added at the end of the file, but your paste actions are not. In fact, I think it may be somewhat...
View ArticleRe: How to find last Pgf of pasted paragraphs?
Thanks Russ, this is great stuff. It solved my problem. And tipping me off that weird things happen at the last paragraph of a flow also helped me to fix another problem I was having, where I was...
View ArticleRe: How to find last Pgf of pasted paragraphs?
Hi Mark, I'm glad that I could help. Regarding your question, no that is not correct. textFrame.LastPgf will reliably give you the last pgf in a text frame. The tricky thing is that each page has its...
View ArticleRe: How to find last Pgf of pasted paragraphs?
Postscript... it's interesting to me that the interface doesn't have a flow.firstPgf or flow.lastPgf property, but it does have pgf.NextPgfInFlow, etc. Or, at least the FDK and ES documentation doesn't...
View ArticleRe: How to find last Pgf of pasted paragraphs?
Hi Russ, you are right. FrameScript has Flow.FirstPgfInFlow and Flow.LastPgfInFlow properties. But apparently these are just FrameScript "shortcuts". Other FrameScript properties that are useful: .Text...
View ArticleRe: How to find last Pgf of pasted paragraphs?
I see the flaw in my FirstTextFrameInFlow.LastPgf. And in asking for the last text frame and last Pgf in that frame, just because you tell The FrameMaker Product to give you them, it does not mean you...
View ArticleRe: Applying a condition to a paragraph
Hello All, This is the script that I use for applying condition tag to a paragraph, and it is not leading to crash in my case. Can anyone of you pls share your complete script so that we can take a...
View ArticleRe: Applying a condition to a paragraph
Here is what I'm using that crashes FM...intended to loop through a doc and change existing condition (PrevTag) to a condition that has been detected in the document (NewTag): function...
View ArticleRe: How to access a table for changes
Here's the working code I ended up using to search through a table and find out if it had any changebars. Mark // Find a changebar in tables. The context is iterating through the Pgfs in a doc.function...
View ArticleAccessing file system
My script needs a Framemaker template file in creating a new file. I've made it work by hard-coding the path to the template in the script: sFilename = "C:\\Users\\gisteppen\\Desktop\\fm change...
View ArticleRe: Accessing file system
You can do something like the code below, which finds a settings file with the same name as the script, but with a .cfg extension. // Make a File object for the settings XML file. var...
View Article600-page Fm file causes script to fail
My script goes through all files in a book to find changebars. It works fine except when it tries to process two very large FrameMaker files, each one being almost 600 pages long. When I try to run one...
View ArticleRe: Accessing file system
Nice! Not only did you point me at $.fileName to get the path to the running script, which would have been plenty, you gave me a good code implementation with a nice regex to boot. So thanks! I was...
View ArticleRe: Accessing file system
You don't have to worry about closing a File object unless you actually open it with the open method.
View ArticleRe: 600-page Fm file causes script to fail
Mark, Stranger things have happened and it is tough to troubleshoot from here. I'd suggest putting in some kind of debug routine to narrow down exactly where the problem is occurring. For example, in...
View ArticleRe: 600-page Fm file causes script to fail
Thanks Russ. Good to know an expert view on it if I go back into this script at some point. But I'm out of time on this project and I'm just having the writer split up those two big files. Mark
View ArticleHow to strip attribute Id values in a chapter by calling FDK APIs for...
HI I like to empty the Id values in a chapter by FDK APIs,how can I do that? Thanks.
View Article