Skip to main content
orys30406838
Participant
December 20, 2021
Question

Show font-size

  • December 20, 2021
  • 1 reply
  • 145 views

Can anyone help, how the script displays the name and font size. my script is "undefined" for the font size

 

var doc = app.activeDocument;
var myLayer = doc.activeLayer;
var sel =doc.selection;
if (sel <= 0){
//docRef.placedItems[0].selected == false;
alert ("Please make a selection");
}
else {
function main () {
var idoc = app.activeDocument;
var myLayer = doc.layers[0];
var itext = idoc.selection[0];
var itextInfo = itext.textRange.characterAttributes;
var text = myLayer.textFrames.add();
alert("Font Name and Size: " + itextInfo.textFont.name + ", " + itextInfo.textFont.point);
}

main();

}

 

 

This topic has been closed for replies.

1 reply

CarlosCanto
Community Expert
Community Expert
December 20, 2021