Copy link to clipboard
Copied
I want to delete all the Index markers in a framemaker document that are starting with text Part No.
Is this possible with Framemaker scripting?
#target framemaker
var doc, marker, nextMarker, regex;
// Set a variable for the active document.
doc = app.ActiveDoc;
// Make a regular expression for the text.
regex = /^Part No\./;
// Process all of the markers in the document.
marker = doc.FirstMarkerInDoc;
while (marker.ObjectValid () === 1) {
nextMarker = marker.NextMarkerInDoc;
// Make sure it is an Index marker.
if (marker.MarkerTypeId.Name === "Index") {
// Check the text.
if (regex.test (marker.MarkerText
...
Copy link to clipboard
Copied
#target framemaker
var doc, marker, nextMarker, regex;
// Set a variable for the active document.
doc = app.ActiveDoc;
// Make a regular expression for the text.
regex = /^Part No\./;
// Process all of the markers in the document.
marker = doc.FirstMarkerInDoc;
while (marker.ObjectValid () === 1) {
nextMarker = marker.NextMarkerInDoc;
// Make sure it is an Index marker.
if (marker.MarkerTypeId.Name === "Index") {
// Check the text.
if (regex.test (marker.MarkerText) === true) {
marker.Delete ();
}
}
marker = nextMarker;
}
Copy link to clipboard
Copied
Thank you.