textItem.size / textItem.leading influencing each other

Anyone, especially newbies, asking for help with Photoshop Scripting and Photoshop Automation - as opposed to those contributing to discussion about an aspect of Photoshop Scripting

Moderators: Tom, Kukurykus

ED209
Posts: 1
Joined: Thu Mar 09, 2017 5:40 pm

textItem.size / textItem.leading influencing each other

Post by ED209 »

Hi, scripting folks!

I'm trying to make a JSX script for Photoshop and I'm having trouble with size AND leading.

When I set a textItem size it modifies the size as well as the leading.
If I modify the leading it will modifie the size as well.

How do I keep both?

In fact I was just modifying a layer's text using the textItem.contents property, but when I set the contents it will modify the textItem.size. :cry:

Code: Select all


var layerText = getMyTextLayer();
var textItem = layerText.textItem;
textItem.contents = _myText;
textItem.size = new UnitValue('44', 'pt');
textItem.leading = new UnitValue('52', 'pt');
I'm using PS CC 2014

Thanks!