4 Replies Latest reply on Sep 19, 2012 2:40 PM by Trevorׅ

    Could be itemByRange flexible?

    Jump_Over Level 5

      Hi,

      This is a beginner problem

       

      There are some paragraphs in "my_story" and  in a few of them lines.length < 6.

      My goal is to apply "my_CSt" characterStyle to every (if possible) from 3 to 6 line of every paragraph of the story.

      but

       

      my_story.paragraphs.everyItem().lines.itemByRange(3,6).isValid


      is false, cause some of paras haven't so many lines.

       

      So, how can I apply my "CSt" to desired selection, using more flexible way,

      then loop step by step into each para to check its lines.length first?

       

      thanks