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

How to Change Textframe Reference Point?

Community Beginner ,
Jan 02, 2018 Jan 02, 2018

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; 

2018-01-02 15_14_29-_Untitled-82 @ 48%.png

Regards,

Senthilvel S

TOPICS
Scripting

Views

2.4K

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

correct answers 1 Correct answer

Guide , Jan 02, 2018 Jan 02, 2018

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;

Votes

Translate

Translate
Guide ,
Jan 02, 2018 Jan 02, 2018

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;

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
Guide ,
Jan 02, 2018 Jan 02, 2018

Copy link to clipboard

Copied

Also the transform reference point is available for document and not for text frame or other individual object..

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
Enthusiast ,
Jan 03, 2018 Jan 03, 2018

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;

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
Community Beginner ,
Jan 04, 2018 Jan 04, 2018

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

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
Community Expert ,
Jan 04, 2018 Jan 04, 2018

Copy link to clipboard

Copied

LATEST

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

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