Copy link to clipboard
Copied
Hi All,
How to change text frame anchor point from AnchorPoint.BOTTOM_LEFT_ANCHOR to AnchorPoint.TOP_LEFT_ANCHOR.
Below code is not working for text frame:
app.activeWindow.transformReferencePoint = AnchorPoint.TOP_LEFT_ANCHOR;
Regards,
Senthilvel S
Your code working fine for me.. which version you are using? Please try the below code also..
app.activeDocument.layoutWindows[0].transformReferencePoint = AnchorPoint.TOP_LEFT_ANCHOR;
Copy link to clipboard
Copied
Your code working fine for me.. which version you are using? Please try the below code also..
app.activeDocument.layoutWindows[0].transformReferencePoint = AnchorPoint.TOP_LEFT_ANCHOR;
Copy link to clipboard
Copied
Also the transform reference point is available for document and not for text frame or other individual object..
Copy link to clipboard
Copied
You will want to use either the default object style or another such as [Basic Text Frame]. InDesign selects Basic Text Frame by default so if you use the default object style [None] you will need to assign that style. Here is the code for setting the default object style (InDesign CC 2017):
var docRef = app.documents[0];
var ancDefault = docRef.anchoredObjectDefaults;
var ancStyle = ancDefault.anchoredObjectStyle;
var test = ancStyle.name;
var ancSettings = {anchoredPosition:AnchorPosition.ANCHORED, anchorPoint:AnchorPoint.TOP_LEFT_ANCHOR};
ancStyle.anchoredObjectSettings.properties = ancSettings;
test;
Copy link to clipboard
Copied
Thank you, Hopkins and tpk1982.
My object is rotated to 90 degrees. So my code is not working. Now the below code is working for me.
app.activeDocument.layoutWindows[0].transformReferencePoint = AnchorPoint.TOP_LEFT_ANCHOR;
Thanks, guys...
Copy link to clipboard
Copied
Hi,
your initial code is working; even if the frame is rotated to 90 degrees.
InDesign is handling the transform reference point exactly that way. Nothing's wrong.
Your expectation was just different compared to the behavior of InDesign 🙂
Regards,
Uwe