1 Reply Latest reply on Dec 8, 2010 3:51 AM by Marijan Tompa [tomaxxi]

    Disply my index(0) as no. 1

    tansk02 Level 1

      Hi all,

       

      Since js is count start from 0. Is it posible to show my index (0) as 1 when alert select items?

       

      For example: If I have 10 nonprinting items in my document, when I run my script it will display my item from 1 to 10.

       

      see my code below.

       

      NonPIt= app.activeDocument.layers.item(0).allPageItems;
      for (a=0; a<NonPIt.length; a++)
      if (NonPIt[a].nonprinting==true)
      {
      app.select(NonPIt[a]);
      alert ("Selected item No. "+ [a]);
      }

       

      thanks,

      tans