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

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

Community Beginner ,
Jun 08, 2020 Jun 08, 2020

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?

748
Translate
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
...
Translate
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) === true) {
            marker.Delete ();
        }
    }
    marker = nextMarker;
}
Translate
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
LATEST

Thank you.

Translate
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