0

I'm trying to change the reference point of an oval in javascript for an InDesign CS5 script. Here's what I've been trying:

function addFid(top, left, bottom, right) {
  var circle = myDoc.ovals.add();
  circle.geometricBounds = [top, left, bottom, right];
  circle.fillColor = myDoc.swatches.item("Black");
  circle.strokeWeight = 0;
  // Apparently, this Object does not support this property or method
  circle.transformReferencePoint = AnchorPoint.CENTER_ANCHOR;
}

For some reason though, when I run this, I get "Object does not support the property or method 'transformReferencePoint'"

I can't find the correct property or method anywhere though (at least not for ovals)

Any help?

atb
  • 943
  • 4
  • 14
  • 30

1 Answers1

1

The transformReferencePoint is a LayoutWindow property.

app.activeWindow.transformReferencePoint = AnchorPoint.CENTER_ANCHOR;

That should solve your issue.

Loic

Loic Aigon
  • 506
  • 3
  • 1
  • 1
    sorry, i'm not super savvy when it comes to indesign. So in inDesign, a window has reference points, not the elements? – atb Jun 28 '12 at 17:53
  • Yep but depending on your intentions, you might not need to use it. If you resize object and wish that this transormation occurs from a certain "transformReferencePoint", you can use an AnchorPoint enumeration. – Loic Aigon Jun 28 '12 at 20:34