3 Replies Latest reply on Jan 4, 2012 8:03 AM by peterpica

    Wonky .jsx Scripts & InD CS5

    peterpica Level 1

      Are there limitations on number of lines in a javascript? Reason I ask is I have 4 scripts, each containing about 10-15 text conversion lines (abbreviations, spelling changes, capitalization, etc.) that I routinely run on a supplied .txt file after formatting with a smart style. Often, some of each do not work; other times, after applying 3 or 4 or 5 of them, my character styling starts going wonky... lightface characters turning to boldface and vice-versa. The total number of lines in the text block is approximately 550 spread over 6 pages, 2 columns.


      See attached dump. Character will randomly change size, change from regular to bold, etc. (The way it's shown is correct.)




      Is this a bug in InDesign or a memory problem or what? Any solution?


      Running InD CS5 7.0.4 on Lion 10.7.2 on Mac Pro (early 2008), 16G ram





        • 1. Re: Wonky .jsx Scripts & InD CS5
          John Hawkinson Level 5

          Are there limitations on number of lines in a javascript?

          Not appreciably. Many people regularly run scripts that are thousands of lines long or more without difficulty.


          As described it sounds like a bug, in InDesign or in your script. I would add checking to your script to detect the failure condition and try to figure out why it goes wrong, and whittle it down to the smallest reproducible case. (Also, the scripting forum is probably more help than here...)

          1 person found this helpful
          • 2. Re: Wonky .jsx Scripts & InD CS5
            Peter Spier Most Valuable Participant (Moderator)

            I doubt this is a problem with the size of the script. I wonder if the text conversion parameters are constucted as precisely as you think and whether some bits are getting converted more times than they should.


            What version of ID are you using? What you've illustrated above looks like it should be achievable with GREP styles, if not directly with a nested style, so I'm not sure why you would need the script at all.

            1 person found this helpful
            • 3. Re: Wonky .jsx Scripts & InD CS5
              peterpica Level 1

              Must be a bug in the smart styles conversion. (I use Wood wing's SmartStyles plugin.) I now just apply the smart styles AFTER all of the .jsx conversions are done and it's fine.


              Thanks for tips.