Hi,
regarding the first problem:
you need to figure out how much the distance is that the printing mark needs to be moved on the even numbered pages. It should be a negative value. Then go to line 18 in the modiefied script and replace "enter your value here" with your value.
I don't have a solution by now how to get that distance value automatically.
Regarding the second problem:
That issue was caused by the if statement
if (m > pages.length-1 || (rectHeight * offset) > pages.bounds[3]) {break;}
It was supposed to stop the loop when
- it reaches the end of the document or
- when the printing mark would be moved off the page
Somehow the second condition doesn't work properly. I don't have a quick solution for this. So the script will no longer check whether or not the mark will be moved off the page.
Here's the modified code:
var doc = app.activeDocument;
var pages =doc.pages;
var rect = pages.firstItem().rectangles.firstItem();
var rectHeight = (rect.geometricBounds[2] - rect.geometricBounds[0]);
var offset = 0;
for (var i = 0; i < pages.length; i+=16)
{
for (var k = 0; k < 16; k++)
{
m = k + i;
if (m % 2 == 0)
{
horizontalOffset = 0;
} else {horizontalOffset = "enter your value here"}
if (m > pages.length-1) {break;}
rect.duplicate(doc.pages, [horizontalOffset, rectHeight * offset]);
}
offset++;
}
rect.remove();