Skip to main content
Known Participant
December 8, 2010
Question

Disply my index(0) as no. 1

  • December 8, 2010
  • 1 reply
  • 284 views

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.nonprinting==true)
{
app.select(NonPIt
);
alert ("Selected item No. "+
);
}

thanks,

tans

This topic has been closed for replies.

1 reply

tomaxxi
Inspiring
December 8, 2010