Skip to main content
Participant
April 29, 2009
Answered

get TextItem.size

  • April 29, 2009
  • 1 reply
  • 1410 views

Hi folks,

I am trying to get the point size of text items in a script. I have tried to simply access the TextItem.size property on both POINT and PARAGRPAH TexItem's but in both cases the property contains NaN. It seems we can only use this property to set the point size?

Does anyone know a way to find out the point size a TextItem uses?

regards

Ben

This topic has been closed for replies.
Correct answer Paul Riggott

You need to have the text layer to be the active layer.

#target photoshop
activeDocument.activeLayer = activeDocument.artLayers.getByName("textLayer");
alert(activeDocument.activeLayer.textItem.size);

1 reply

Paul Riggott
Paul RiggottCorrect answer
Inspiring
April 29, 2009

You need to have the text layer to be the active layer.

#target photoshop
activeDocument.activeLayer = activeDocument.artLayers.getByName("textLayer");
alert(activeDocument.activeLayer.textItem.size);

Ben_J_DAuthor
Participant
April 30, 2009

After some more testing it seems that we can get the point size of a text item even if it is not the active layer, the problem I am having seems to be related to PatchPanel, either that or there is a problem in my project somewhere else causing the error. I have started a new thread over at the patchpanel forums to see if anyone there can reproduce the problem.