2 Replies Latest reply on Dec 30, 2011 10:44 PM by mr.pathi

    Turn on/off in the paragraph rules above/below

    mr.pathi Level 1

      I have InDesign file which is having the Paragraph styles named Box1, Box2, Box3 etc., The Box1 output is Box with number 1 and the Box2 output is Box with number 2 etc.,

       

      The Box style has many styles like paragraph rules below/above, character color etc., But inside the Box style options, always Paragraph Rules => Rule Above/Below options will be truned off. The reason is we apply the Box1 style for Chapter 1 indd files, Box2 style for Chapter 2 indd files etc.,

       

      If I opened the Chapter 1 (25+ indd) files i should turn on the Paragraph rule above/below for Box1 (Box1=>Paragraph Rules=>Rule Above/Below), Chapter 2 i should turn on the Box2=>Paragraph Rules=>Rule Above/Below options etc.,

       

      Chapter 1 (Opened 25+ files) => Box1 Style => Paragraph Rules => Turn on Rule Above/Below

       

      Chapter 2 (Opened 25+ files) => Box2 Style => Paragraph Rules => Turn on Rule Above/Below

       

      Chapter 3 (Opened 25+ files) => Box3 Style => Paragraph Rules => Turn on Rule Above/Below

       

      .....

       

      Thanks in Advance,

      Thiru

        • 1. Re: Turn on/off in the paragraph rules above/below
          siva prasath Level 1

          Hi thiru

           

          Chk this script and let me now any query.........

           

           

           

          var openedDocs = app.documents;
          //alert (openedDocs);
          var myDocument = app.activeDocument;
          var chapterPrefix = prompt ("Enter the paragraph style", "Box1", "TURN ON THE PARAGRAPH RULES");
          for (var doc=0; doc<openedDocs.length; doc++){
          //alert (doc);
          var chapterPrefix1 = openedDocs[doc].paragraphStyles.item(chapterPrefix);
          //alert (chapterPrefix);
          if (chapterPrefix1.ruleAbove==true && chapterPrefix1.ruleBelow==true){
                    //alert ("hh");
          chapterPrefix1.ruleAbove=false;
          chapterPrefix1.ruleBelow=false;
          }
          else {
          //alert ("else");
          chapterPrefix1.ruleAbove=true;
          chapterPrefix1.ruleBelow=true;
                    }
          
          
          }
          
          
          • 2. Re: Turn on/off in the paragraph rules above/below
            mr.pathi Level 1

            Hello prasath,

             

            its working, thanks a lot..

             

            thanks,

            thiru