9 Replies Latest reply on Jan 13, 2016 8:19 AM by Wiedenmaier

    Strip structure from document

    SRZBln

      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

        • 1. Re: Strip structure from document
          Lynne A. Price Level 4

          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

          • 2. Re: Strip structure from document
            SRZBln Level 1

            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

            • 4. Re: Strip structure from document
              Wiedenmaier Level 3

              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[i];

                          FA_errno = 0 ;

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

                          var fcodes = new Array(); //Fcodes

                          fcodes.push(cmd.Fcode);

                          Fcodes(fcodes); // Fcode Execution

                      }

                  }

              • 5. Re: Strip structure from document
                SRZBln Level 1

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

                I look to try this.

                • 6. Re: Strip structure from document
                  SRZBln Level 1

                  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 :-)

                  • 7. Re: Strip structure from document
                    Wiedenmaier Level 3

                    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

                    • 8. Re: Strip structure from document
                      SRZBln Level 1

                      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

                      • 9. Re: Strip structure from document
                        Wiedenmaier Level 3

                        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