7 Replies Latest reply on Mar 18, 2010 10:28 AM by John Hawkinson

    Newbie scripting question: how to change a story into a particular style

    JoJo Jenkins Level 1

      I'm new to scripting, and I am getting to know the built-in script FindChangeByList. (I'm using InDesign CS4 for Windows.) I'm using the excellent Find Change Record script by Martin Fisher (modified by Kasyan Servetsky). It's working brilliantly, but I have a question. I want to add a FindChangeList string that will take an entire selection or story and turn it all into a particular style (the actual name of my style is "Body2.TextIndent"). This should be the easiest thing to do, but as a newbie I'm stumped. The only thing I could come up with was to find "any character" and replace it with the style I wanted, so something like this:


      text {findWhat:"^?"} {appliedParagraphStyle:"Body2.TextIndent", changeConditionsMode:1919250519} {includeLockedStoriesForFind:false, includeLockedLayersForFind:false, includeHiddenLayers:false, includeMasterPages:false, includeFootnotes:true, wholeWord:false, caseSensitive:false} //Transform entire story into Body2.TextIndent style


      This does work, but it's very, very slow. I assume that the program has to change every character to the style I want, which is why it takes so long. Is there a faster, more efficient way to write this? Again, I'm simply trying to turn the entire story into a particular style. Obviously, this could be done with two clicks in InDesign proper, but I want to incorporate this into the FindChangeByList syntax.




      P.S. Is there any difference in using FindChangeByList in the Javascript version versus the Visual Basic version? I randomly picked the Visual Basic version and that's what I've been using.  (I'm using the Find Change Record script to develop my strings, as I stated above.)