var shift = 3 // mm
var matrixOdd = app.transformationMatrices.add();
matrixOdd = matrixOdd.translateMatrix (-shift/0.352778, 0)
var matrixEven = app.transformationMatrices.add();
matrixEven = matrixEven.translateMatrix (shift/0.352778, 0)
function main () {
for ( i = 0; i < app.activeDocument.masterSpreads.length; i++ ) {
mp = app.activeDocument.masterSpreads[i].pages;
if (mp.length == 2) {
mp[0].transform(CoordinateSpaces.INNER_COORDINATES, AnchorPoint.centerAnchor, matrixOdd);
mp[1].transform(CoordinateSpaces.INNER_COORDINATES, AnchorPoint.centerAnchor, matrixEven);
};
};
for ( i = 0; i < app.activeDocument.pages.length; i++ ) {
p = app.activeDocument.pages[i];
if (i%2 == 0) {
p.transform(CoordinateSpaces.INNER_COORDINATES, AnchorPoint.centerAnchor, matrixEven);
} else {
p.transform(CoordinateSpaces.INNER_COORDINATES, AnchorPoint.centerAnchor, matrixOdd);
};
};
};
app.doScript(main, ScriptLanguage.JAVASCRIPT, [], UndoModes.ENTIRE_SCRIPT, 'Shift in the root');