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

change second page size in 3-page spread

Engaged ,
Jul 21, 2015 Jul 21, 2015

Hi,

I'm wondering, how can I change second page size in 3-page spread with ExtendScript?

(I'm trying to generate cover with spine)

TOPICS
Scripting
929
Translate
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

correct answers 1 Correct answer

Advisor , Jul 22, 2015 Jul 22, 2015

app.activeWindow.activeSpread.pages[1].resize(CoordinateSpaces.innerCoordinates, AnchorPoint.centerAnchor, ResizeMethods.ADDING_CURRENT_DIMENSIONS_TO, [-1000, 0])

Translate
Engaged ,
Jul 22, 2015 Jul 22, 2015

oh, come on! nobody knows how to do this with a script?

InDesign change page size.jpg

Translate
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
Advisor ,
Jul 22, 2015 Jul 22, 2015

app.activeWindow.activeSpread.pages[1].resize(CoordinateSpaces.innerCoordinates, AnchorPoint.centerAnchor, ResizeMethods.ADDING_CURRENT_DIMENSIONS_TO, [-1000, 0])

Translate
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
Engaged ,
Jul 22, 2015 Jul 22, 2015

any ideas how to set size in mm instead of pixels?

and set exact size for "page" (spine), instead of counting from left page? for example spine should be 5 mm width and 303 mm tall

Translate
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
Engaged ,
Jul 22, 2015 Jul 22, 2015

found it here!

function setWidthHeight(/*PageItem*/o, /*str*/w, /*str*/h, /*bool=false*/useVisibleBounds)

{

  if( !o.resize ) return;

  

  var CS_INNER = CoordinateSpaces.INNER_COORDINATES,

  BB = BoundingBoxLimits[(useVisibleBounds?'OUTER_STROKE':'GEOMETRIC_PATH') + '_BOUNDS'];

  

  var wPt = UnitValue(w).as('pt'),

  hPt = UnitValue(h).as('pt');

  

  if( 0 >= wPt || 0 >= hPt ) return;

  

  o.resize(

  [CS_INNER,BB],

  AnchorPoint.CENTER_ANCHOR,

  ResizeMethods.REPLACING_CURRENT_DIMENSIONS_WITH,

  [wPt,hPt,CS_INNER]

  );

}

// Sample code

// ---

setWidthHeight(app.selection[0], "5cm", "50pt");

Translate
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
Advisor ,
Jul 22, 2015 Jul 22, 2015
LATEST

Resize works in points, not pixels.

To convert between units use UnitValue

The resize method: Page
UnitValue: http://www.indesignjs.de/extendscriptAPI/indesign10/#UnitValue.html

More info on resizing: Scripting InDesign: Transformations

Best info on transformations (thus also resizing) so far: http://www.indiscripts.com/post/2014/03/coordinate-spaces-and-transformations-1

Translate
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