Highlighted

FrameMaker unresponsive after running script, 'ENGINE BUSY'

New Here ,
Mar 28, 2017

Copy link to clipboard

Copied

Hello scripters!

I've recently run into a small problem and I'm wondering if anyone has experienced the same and/or could shed any light on the issue. I have a script which, when run on large (~250 page) documents, renders FM completely unresponsive and requires me to force quit the application. The script isn't anything fancy, it simply walks through the active doc and inserts index markers into specific paragraphs. These are the important bits:

// adds index markers to doc

function addIndexMarkers(doc, pgf)

{

    // walk through pgfs in the main doc flow

    while (pgf.ObjectValid()) {

        var pgfFmt = pgf.Name;

        if (pgfFmt == "thing1" || pgfFmt == "thing2") {

            var offset = getOffset(pgf);

            var text = getText(pgf);

            createMarker(doc, pgf, offset, "Index", text);

        }

        pgf = pgf.NextPgfInFlow;

    }

}

// returns the offset to first char in the provided pgf

// will return different values for structured and

// unstructured documents

function getOffset(pgf) {

    return pgf.GetText(Constants.FTI_String)[0].offset;

}

// returns the textual data of the provided pgf

function getText(pgf)

{

    var textItems;

    var text = "";

    textItems = pgf.GetText(Constants.FTI_String);

    for (var i = 0; i < textItems.length; i++) {

        if (textItems.dataType == Constants.FTI_String) {

            text += textItems.sdata;

        }

    }

    return text;

}

// creates an index marker and places it at the specified

// offset position within the given pgf

function createMarker(doc, pgf, offset, type, text)

{

    var textLocation = new TextLoc(pgf, offset);

    var marker = doc.NewAnchoredObject(Constants.FO_Marker, textLocation);

    var markerType = doc.GetNamedObject(Constants.FO_MarkerType, type);

    marker.MarkerTypeId = markerType;

    marker.MarkerText = text;

}

The script makes it all the way to the end, I see my "Script Complete" message then ESTK just keeps spinning and FrameMaker becomes unresponsive. If I stop the script and try to restart it, I get 'ENGINE BUSY'. Again, this only happens on large documents (both structured and unstructured). I tried with ~100 page docs and it works just dandy.

Any ideas on why this might be happening?

TOPICS
Scripting

Views

336

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

FrameMaker unresponsive after running script, 'ENGINE BUSY'

New Here ,
Mar 28, 2017

Copy link to clipboard

Copied

Hello scripters!

I've recently run into a small problem and I'm wondering if anyone has experienced the same and/or could shed any light on the issue. I have a script which, when run on large (~250 page) documents, renders FM completely unresponsive and requires me to force quit the application. The script isn't anything fancy, it simply walks through the active doc and inserts index markers into specific paragraphs. These are the important bits:

// adds index markers to doc

function addIndexMarkers(doc, pgf)

{

    // walk through pgfs in the main doc flow

    while (pgf.ObjectValid()) {

        var pgfFmt = pgf.Name;

        if (pgfFmt == "thing1" || pgfFmt == "thing2") {

            var offset = getOffset(pgf);

            var text = getText(pgf);

            createMarker(doc, pgf, offset, "Index", text);

        }

        pgf = pgf.NextPgfInFlow;

    }

}

// returns the offset to first char in the provided pgf

// will return different values for structured and

// unstructured documents

function getOffset(pgf) {

    return pgf.GetText(Constants.FTI_String)[0].offset;

}

// returns the textual data of the provided pgf

function getText(pgf)

{

    var textItems;

    var text = "";

    textItems = pgf.GetText(Constants.FTI_String);

    for (var i = 0; i < textItems.length; i++) {

        if (textItems.dataType == Constants.FTI_String) {

            text += textItems.sdata;

        }

    }

    return text;

}

// creates an index marker and places it at the specified

// offset position within the given pgf

function createMarker(doc, pgf, offset, type, text)

{

    var textLocation = new TextLoc(pgf, offset);

    var marker = doc.NewAnchoredObject(Constants.FO_Marker, textLocation);

    var markerType = doc.GetNamedObject(Constants.FO_MarkerType, type);

    marker.MarkerTypeId = markerType;

    marker.MarkerText = text;

}

The script makes it all the way to the end, I see my "Script Complete" message then ESTK just keeps spinning and FrameMaker becomes unresponsive. If I stop the script and try to restart it, I get 'ENGINE BUSY'. Again, this only happens on large documents (both structured and unstructured). I tried with ~100 page docs and it works just dandy.

Any ideas on why this might be happening?

TOPICS
Scripting

Views

337

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
Mar 28, 2017 0
Enthusiast ,
Mar 28, 2017

Copy link to clipboard

Copied

Hi carlm80163462,

same problem here with large documents:

Framemaker 12 and Framemaker 15 get stuck after one complete traversal of all Paragraphs in the doc

I've reported this bug to the developers.

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
Reply
Loading...
Mar 28, 2017 0