0 Replies Latest reply on Dec 16, 2010 10:55 AM by IT.Coordinator

    would this loop work?

    IT.Coordinator Level 1

      var mySel = app.selection[0]

      var myStory = mySel.parentStory; // Now we are pointing to the entire story


      var myHolidayStyle1 = "Holiday-Header" // Header 'day of the week'
      var myHolidayStyle2 = "Holiday-Sub-Heading-Date" // Header 'month and day'
      var myHolidayStyle3 = "Holiday-Header-Body" // Lead Paragraph 'default paragraph style'

       

       

       

      // If text doesn't  equal Day of the week like Monday and doesn't equal month and date like Decmber 14
      // then the document loops into doing the the rest of the document in Holiday-Header-Body
      // not sure if this loop will stop once it reaches another day of the week and then repeat the above tasks again.

       

      // not sure if I did this IF selection not equal Holidaystyle 0 and style 1 then perform loop, correctly???

       

       

      if (mystory =!  [myHolidayStyle0], [myHolidayStyle1]) {
          for (loop=0; loop<myStory.paragraphs.length; loop++)
        myStory.paragraphs[loop].appliedParagraphStyle = myHolidayStyle3;
        }