9 Replies Latest reply on Dec 5, 2011 12:32 AM by Jimmy Høiby

    Insert character in front of text set with certain paragraph style

    Jimmy Høiby

      Hi

       

      I am a beginner in the art of scriptning InDesign and I have a challenged which I know can be solved by javascript in InDesign.

       

      This is in InDesign CS5.5.

       

      Simply I want to insert a "S" in front of all paragraphs set with the paragraph style "Silkeborg".

       

      I have struggled a bit with it and have made this:

       

      var doc = app.activeDocument;
      var intSelect = app.selection.length;
      var arrSelection = [];
      arrSelection = app.selection[0];
      app.selection[0].insertionPoints[0].contents = "S ";
      

       

      But this only inserts in the first paragraph.