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

Strip structure from document

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

TOPICS
Scripting

Views

1.0K

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

Engaged , Jan 13, 2016 Jan 13, 2016

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() ;

   

...

Votes

Translate

Translate
Advisor ,
Jan 13, 2016 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

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

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

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

        }

    }

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

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

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

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

Copy link to clipboard

Copied

LATEST

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

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

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