Reply To: Object Style to New Layer

#103540

Oleh, weird indeed!

Assume you have one page with 4 items.

pageItems[0] > wrong style
pageItems[1] > right style to move
pageItems[2] > right style to move
pageItems[3] > wrong style

If you move forwards within a collection you should get the following result:

pageItems[1] is moved to the new layer, but if you check the index of this object, the index is now [3]. That means, the previous [2] becomes [1] and will be ignored (!), and the previous [3] is now [2] and fails, because of the wrong style. But the previous [1] whos index is now [3] will be examined again.

This will not happen (normally), if you loop backwards or if you deal with pI = app.activeDocument.pageItems.everyItem().getElements() as static array forwards.

However: I had some issues with forwards or backwards in the past too ;-)

This article was last modified on May 4, 2018

Comments (0)

Loading comments...