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

Community Beginner ,
Jun 08, 2020 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

403

Likes

Translate

Translate

Report

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

correct answers 1 Correct answer

Adobe Community Professional , Jun 08, 2020 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
Adobe Community Professional ,
Jun 08, 2020 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
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jun 10, 2020 Jun 10, 2020

Copy link to clipboard

Copied

LATEST

Thank you.

Likes

Translate

Translate

Report

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