Skip to main content
Participant
November 10, 2022
Answered

How do I implement right align text with photoshop script?

  • November 10, 2022
  • 2 replies
  • 903 views
var txlayerRef = app.activeDocument.artLayers.add()
txlayerRef.kind = LayerKind.TEXT;
txlayerRef.name = "info";
var myTextRef = txlayerRef.textItem;
myTextRef.contents = "*Do what you want\r*till the end";
myTextRef.font = "Arial";
myTextRef.AnchorPosition = "MIDDLECENTER";
myTextRef.size = 10;

Within photoshop script, How can I align text to right side?

Can't find reference from "photoshop-javascript-ref-2020"..

 

This topic has been closed for replies.
Correct answer Charu Rajput

Hi @curtis.Y 

You mean justification, if yes then add following line of code in your's code

myTextRef.justification = Justification.RIGHT;

 

2 replies

Stephen Marsh
Community Expert
Community Expert
November 10, 2022

Align is the correct typographic term. The masses, including graphics software devs who should know better, simply use justification to mean align.

Chuck Uebele
Community Expert
Community Expert
November 10, 2022

Actually, I believe justification is the correct term, as there is right, center, left, and full justification. I don't think there is a full alignment.

Stephen Marsh
Community Expert
Community Expert
November 10, 2022

Not according to this former compositor. :]

 

There is left, right or centre alignment (range), with justification having the same alignment/range for the short last line in a paragraph.

Charu Rajput
Community Expert
Charu RajputCommunity ExpertCorrect answer
Community Expert
November 10, 2022

Hi @curtis.Y 

You mean justification, if yes then add following line of code in your's code

myTextRef.justification = Justification.RIGHT;

 

Best regards