Skip to main content
SRZBln
Participant
January 13, 2016
Answered

Strip structure from document

  • January 13, 2016
  • 1 reply
  • 1533 views

Hi and all the best in new year!

If I like to open a structured document in unstructured framemaker-app, I can use Constants.FV_StripStructureAndOpen in open-parameters.

Is there any way to delete the structure information in a document to get the same document with all formats and text without structure, when the document is open in structured framemaker-app?

Thank you for all your ideas

Ute

This topic has been closed for replies.
Correct answer Wiedenmaier

Hi Ute,

I think this shoud do the Job.

Markus

    function RemoveStructureWithFcode()

    {

        var rangeArray = new Array() ;

        var flow = app.ActiveDoc.FirstFlowInDoc;

        while (flow.ObjectValid())

        {

            var firstPgf = flow.FirstTextFrameInFlow.FirstPgf;

            flow = flow.NextFlowInDoc;

            if (flow.HighestLevelElement.ObjectValid()==false)

                continue ;

            var range = new TextRange() ;

            range.beg = new TextLoc() ;

            range.end = new TextLoc() ;

            range.beg.obj = firstPgf;

            range.beg.offset = 0 ;

            range.end.obj = range.beg.obj;

            range.end.offset = 0 ;

            rangeArray.push(range) ;

        }

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

        {

            app.ActiveDoc.TextSelection = rangeArray;

            FA_errno = 0 ;

            var cmd = app.GetNamedCommand ("RemoveStruct");

            var fcodes = new Array(); //Fcodes

            fcodes.push(cmd.Fcode);

            Fcodes(fcodes); // Fcode Execution

        }

    }

1 reply

Inspiring
January 13, 2016

Special > Remove Structure from Flow removes the element hierarchy from a flow, leaving the content unstructured. It may created new paragraph formats that maintain the original appearance.

If you want to remove the element catalog from the document, import element definitions from a document that does not have any element definitions.

         --Lynne

SRZBln
SRZBlnAuthor
Participant
January 13, 2016

thank you Lynn,

I like to remove the structure within an extend script.

My script is: 1. open xml-file, 2. save as fm, 3. remove structure 4. save as in an older fm version.

-> it runs all fine, but only how I can remove structure I could'nt find in any extendscripts-guides.

Importing an empty element catalog don't remove structure and destroy all formats.

Ute

Klaus Göbel
Legend
January 13, 2016

Maybe, you'll find the answer here:

How do I "Remove Structure from Flow" in a Script