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

align text right in textframe (in script)

Participant ,
May 30, 2020 May 30, 2020

Copy link to clipboard

Copied

Hi,

(scripting)

a) How align text in textframe to the Right?

TOPICS
Scripting

Views

2.2K

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

Community Expert , May 30, 2020 May 30, 2020

Run the following code with a selected textframe

app.selection[0].parentStory.justification = Justification.RIGHT_ALIGN

 

If right justified is needed then use the following value for assignment 

Justification.RIGHT_JUSTIFIED

 

The different values that can be used are mentioned in the following link

https://www.indesignjs.de/extendscriptAPI/indesign-latest/#Story.html

 

-Manan

Votes

Translate

Translate
Community Expert ,
May 30, 2020 May 30, 2020

Copy link to clipboard

Copied

Run the following code with a selected textframe

app.selection[0].parentStory.justification = Justification.RIGHT_ALIGN

 

If right justified is needed then use the following value for assignment 

Justification.RIGHT_JUSTIFIED

 

The different values that can be used are mentioned in the following link

https://www.indesignjs.de/extendscriptAPI/indesign-latest/#Story.html

 

-Manan

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 ,
May 30, 2020 May 30, 2020

Copy link to clipboard

Copied

Note that Manan's solution would do the alignment to every paragraph is all text frames linked to the text frame in question. If you just want to hit the paragraphs in a specific text frame, with the frame selected: 

app.selection[0].paragraphs.everyItem().justification = Justification.RIGHT_ALIGN;

 

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
Participant ,
Mar 31, 2023 Mar 31, 2023

Copy link to clipboard

Copied

LATEST

Just what I needed, thank you!! I used the center align version so

MyTextBox.parentStory.justification = Justification.CENTER_ALIGN;

 

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
Participant ,
May 31, 2020 May 31, 2020

Copy link to clipboard

Copied

Manan & Brian

Thanks... understand... it works like I want!

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