Copy link to clipboard
Copied
How can I set different dimentions on different pages?
This does not work - bounds are r/o:
What do i need to change?
set myList to {{300, 250}, {980, 300}, {320, 250}, {580, 400}, {970, 250}, {300, 600}, {980, 150}, {300, 300}}
repeat with i from 1 to count myList
set x to item i of myList
tell application id "com.adobe.indesign"
tell active document
tell page i
set bounds to {0, 0, item 2 of x, item 1 of x}
end tell
end tell
end tell
end repeat
Copy link to clipboard
Copied
I don't have a Mac at hand, but here I wrote an equivalent (working) code in JS:
main();
function main() {
var doc = app.activeDocument;
var pages = doc.pages;
var myList = [[300, 250], [980, 300], [320, 250], [580, 400], [970, 250], [300, 600], [980, 150], [300, 300]];
for (var i = 0; i < myList.length; i++) {
pages.resize(CoordinateSpaces.INNER_COORDINATES, // In -- CoordinateSpaces enumerator
AnchorPoint.CENTER_ANCHOR, // From -- The transform origin
ResizeMethods.REPLACING_CURRENT_DIMENSIONS_WITH, // By -- How the current dimensions are affected by the given values
myList); // Values -- The width and height values
}
}
I am assuming that the number of pages is the same as the number of elements in the list (array).
I think it won't be difficult to translate it from JS to AS.
Hope it helps!
— Kas