• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

[AS] Change dimentions on pages

Explorer ,
Nov 15, 2017 Nov 15, 2017

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

TOPICS
Scripting

Views

220

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guru ,
Nov 16, 2017 Nov 16, 2017

Copy link to clipboard

Copied

LATEST

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).

16-11-2017 14-23-04.png

I think it won't be difficult to translate it from JS to AS.

Hope it helps!

— Kas

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines