Highlighted

Strip structure from document

Community Beginner ,
Jan 13, 2016

Copy link to clipboard

Copied

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

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

        }

    }

TOPICS
Scripting

Views

812

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

Strip structure from document

Community Beginner ,
Jan 13, 2016

Copy link to clipboard

Copied

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

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

        }

    }

TOPICS
Scripting

Views

813

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
Jan 13, 2016 0
Adobe Community Professional ,
Jan 13, 2016

Copy link to clipboard

Copied

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

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...
Jan 13, 2016 1
Community Beginner ,
Jan 13, 2016

Copy link to clipboard

Copied

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

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...
Jan 13, 2016 0
Enthusiast ,
Jan 13, 2016

Copy link to clipboard

Copied

Maybe, you'll find the answer here:

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

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...
Jan 13, 2016 0
Engaged ,
Jan 13, 2016

Copy link to clipboard

Copied

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

        }

    }

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...
Jan 13, 2016 0
Community Beginner ,
Jan 13, 2016

Copy link to clipboard

Copied

Now I find an answer from Russ in https://forums.adobe.com/message/6619668#6619668 using Fcode-function.

I look to try this.

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...
Jan 13, 2016 0
Community Beginner ,
Jan 13, 2016

Copy link to clipboard

Copied

Hi Markus,

thank you very much! Actually I get after removing structure a dialog like this "structure will be removed - you like really?".

And so I look to find the fcode for closing dialog with ok.

best regards 🙂

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...
Jan 13, 2016 0
Engaged ,
Jan 13, 2016

Copy link to clipboard

Copied

Hi Ute,

yes. right. there is such a boring message 🙂

You can confirm this with an FCODE or ExtendScript, AFAIK...

If you want to automate this, you need to fire an event from an external application or thread. This can't be done by ExtendScript.

There are tools like "Push that freaking button", which can do that work as a Background worker. Macro Recorder and Mouse Auto Clicker

I'm sure it was for free in former times. Currently it costs $39,99. But even cheaper than implementing this by one self.

Markus

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...
Jan 13, 2016 0
Community Beginner ,
Jan 13, 2016

Copy link to clipboard

Copied

Hi Markus,

do you confirm, that fcode works without showing any dialog, because you set the textselection?

It works fine. Thank you very much.

Ute

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...
Jan 13, 2016 0
Engaged ,
Jan 13, 2016

Copy link to clipboard

Copied

Hi Ute,

you're welcome

a Long time that I used it at last, but I think a Dialog appears any time a flow with structure was recognized and fcodes excecutes...

If so, you have to workaround that, as mentioned

Markus

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...
Jan 13, 2016 0