• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

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

541

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

Community Expert , 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
...

Votes

Translate

Translate
Community Expert ,
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;
}

Votes

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.

Votes

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