Script to add markers to text by paragraph format
With previous versions of Framemaker, I had a FrameScript which would loop through my document and add a marker to text based on the paragraph format applied. The marker text would be the selected paragraph.
I am now trying to recreate this in Extendscript for use in Framemaker 10 and am completely stumped.I have no doubt that my script (copied below) is completely off-track, but I wondered if anybody would be able to help point me in the direction of my many mistakes.
Basically, I want the script to find all paragraphs with the "*Part no." format applied, make that text the text range and then apply a marker to that range. A bit of research has shown that I probably need to create a list of paragraph formats, but I believe that I have far more problems than just that.
var pgfFmt1 = flow.GetNamedPgfFmt (*Part no.);
while (pgfFmt1.ObjectValid())
{
function createMarker (doc, pgf, offset, type, text) {
var tRange, marker;
tRange = pgfFmt1.TextRange;
marker = doc.NewAnchoredObject(Constants.FO_Marker, tRange);
marker.MarkerType = type;
marker.MarkerText = text;
return 1;
}
createMarker (doc, pgf, 0, "Index", 0);
Many thanks in advance to anyone who is able to offer me some pointers!
