2 Replies Latest reply on Feb 20, 2012 7:37 PM by Angusdog

    JS: Finding & replacing a character with a certain para style

    Angusdog Level 1

      I'm scripting an automated indd -> PDF project and I need to minimise the user input.

       

      To this end, I want to search and replace commas in a particular cell of a table (which are the only instances of a particular para style), and replace them with forced line breaks.

       

      The script I have for another part of the XML import looks like this:

       

      //Search the document for the umlauts and replaces them with macrons. I

      app.findTextPreferences.findWhat = "Ï";

      app.changeTextPreferences.changeTo = "Ī";

      myDocument.changeText();

       

      What do I add to a similar script to make it target only content whish has a particular para style? And will it be compatible with CS4, 5 and 5.5, i.e. be agnostic to nested styles etc?

       

      Thanks in advance,

       

      Simon.