Delete all markers starting with "Part No" and type "Index"

Community Beginner ,
Jun 08, 2020

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?

Views

338

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

1 Correct Answer

Adobe Community Professional , Jun 08, 2020
frameexpert Adobe Community Professional , Jun 08, 2020
#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...

Likes

Translate

Translate
Jump to answer Jump to answer
Adobe Community Professional ,
Jun 08, 2020

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;
}

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
sam_Jack1 AUTHOR LATEST
Community Beginner ,
Jun 10, 2020

Copy link to clipboard

Copied

Thank you.

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more