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

How to center the text in EditText and StaticText

Participant ,
Sep 04, 2023 Sep 04, 2023

I am writing a jsx script.

When I dynamically rewrite StaticText, the text is aligned to the left.
I believe this is because the alignment of the text in StaticText is left-aligned (like Paragraph in the text layer).
The same is true in EditText. The text is drawn left-aligned to the bounding box.
Is there any way to center this?

 

TOPICS
How to , Scripting
618
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

Enthusiast , Sep 04, 2023 Sep 04, 2023

You can use a `justify` property value of `center` for the EditText fields.

 

Be aware that ScriptUI is on its way out for being supported.  I'm not saying stop writing your code, but just be aware that ScriptUI is buggy from the UI layout perspective.  Some documented things simply to not work.   ScriptUI is something you have to just take as it comes.  

 

Most developers have moved into CEP and UXP which is what Adobe will officially support moving forward.  While I don't have any official word fr

...
Translate
Enthusiast ,
Sep 04, 2023 Sep 04, 2023

You can use a `justify` property value of `center` for the EditText fields.

 

Be aware that ScriptUI is on its way out for being supported.  I'm not saying stop writing your code, but just be aware that ScriptUI is buggy from the UI layout perspective.  Some documented things simply to not work.   ScriptUI is something you have to just take as it comes.  

 

Most developers have moved into CEP and UXP which is what Adobe will officially support moving forward.  While I don't have any official word from Adobe, I don't think they plan on deprectating ScriptUI fully but you should be aware that it has stopped being supported.

 

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
Participant ,
Sep 04, 2023 Sep 04, 2023
LATEST

Thank you!

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