7 Replies Latest reply on Dec 21, 2013 5:43 AM by Laubender

    Script that will show the character count of all carriage resturns

    Blujely

      I have found a bug when exporting an indd to idml. If a a carriage return falls in a character count that is a multiple of 8000 + 1 it is converted to a paragraph separator (u2029). I am in the process of mass exporting around 3000 files to idml for a project. I am trying to come up with a way with a script to check the files to see if carriage returns exist in these locations. I am fairly new to scripting and don't know how this would be done. I know it is possible to get character counts but is it possible to check if a character exists in a certain character count from the beginning of a story? Any help on this would be appreciated.

       

      Also has anyone else ran into this with exporting to idml? I have submitted a bug report. This is can be recreated across multiple computers, OS's and versions of InDesign.

        • 1. Re: Script that will show the character count of all carriage resturns
          Laubender Adobe Community Professional & MVP

          @Blujely – to see that right:

           

          if character \n is  at position 8001 (or a multiple of that) in, and here I'm not sure what you exactly mean:

           

          1. The actual Story in an InDesign file?

           

          2. The Story_xxxx.xml of the IDML file?

          Counted from the beginning "<?xml" to the end "</idPkg:Story>"?

           

          3. Something else?

           

          What is the DOMVersion of the IDML?
          (Second line in a Story_xxxx.xml)

           

          Could you detect that also with the Snippet format IDMS?

           

          Uwe

           

          Message was edited by: Laubender

          • 2. Re: Script that will show the character count of all carriage resturns
            Blujely Level 1

            @Laubender

             

            Thank you for responding.

             

            I was referring to what you said in number 1 above. It is the character count from the beginning of any story. I have actually tested it on two different stories in the same file and if a paragraph return exists in the 8001 (or a multiple of it) from the beginning of each it will do it in each.

             

            I hadn't tested it with a snippet but I did after you asked. I get the same result with that.

             

            As for your question about the DOMVersion, I am not familiar with uncompressing idmls. I do however have a tool that decompresses them and gives me all the story xmls separately but the line you are refering to is not there. The tool I am using must be dropping them automatically. The second line of the story xml that I get has the story preferences.

            • 3. Re: Script that will show the character count of all carriage resturns
              Blujely Level 1

              Okay I have the DOMVersion it is 8.0

              • 4. Re: Script that will show the character count of all carriage resturns
                Laubender Adobe Community Professional & MVP

                @Blujely – The DOMVersion number refers to the InDesign version number (in your case v8, InDesign CS6 or its CC equivalent).

                 

                A quick test in my InDesign CS5.5 v7.5.3 on Mac OSX 10.6.8 in this regard was showing no problem at all. DOMVersion 7.5.

                 

                I cannot test it right now with CS6, but we have to make sure, if the problem is

                either:

                1. At the sender's side (the export module – IDML Export or IDMS Export of InDesign)

                or:

                2. At the side of the reciever, could be InDesign's importing module or a 3rd party tool like a Translation Memory Software like Trados.

                 

                To check the sender's side:

                If you have that Story_xxxx.xml file open, could you detect the wrong character already there? Search for a unique word near the problem character you have seen on the reciever's side.

                 

                What exact version of InDesign are you using to export the IDML/IDMS?

                 

                In InDesign go to the menu "About InDesign" and look after something like version 8.0.0 or 8.0.1 or 8.0.2 (the latest bug-fix version).

                 

                What software is showing the problem when you import/place/open the IDML/IDMS?

                 

                Uwe

                • 5. Re: Script that will show the character count of all carriage resturns
                  Laubender Adobe Community Professional & MVP

                  @Blujely – about your initial question about showing a specific character at an n-th position in a story, you could use a simple GREP search in InDesign and restrict that search to a specific story (e.g. the story of a selected piece of text):

                   

                  Search for the n-th position with the formular in dummy-syntax:

                   

                  Positive look behind of any character in the exact length n-1 + character
                  

                   

                  E.g. if you want to look for a "carriage return", defined in GREP as \n at every 10th position, search for:

                   

                  (?<=.{9})\n
                  

                   

                  In your case that would be:

                   

                  (?<=.{8000})\n
                  

                   

                  Uwe

                  • 6. Re: Script that will show the character count of all carriage resturns
                    Laubender Adobe Community Professional & MVP

                    Sorry. That GREP cannot work or is leading to false assumptions…
                    Because "\n" seems to be not in the class of "." in GREP speak.

                     

                    I'll try a different approach that includes all white space in the search with  character classes later.

                     

                    Uwe

                    • 7. Re: Script that will show the character count of all carriage resturns
                      Laubender Adobe Community Professional & MVP

                      That GREP could work for every 10th position:

                       

                      (?<=[\s\w]{9})\n
                      

                       

                      Or every 8001th position:

                       

                      (?<=[\s\w]{8000})\n
                      

                       

                      Uwe