Copy link to clipboard
Copied
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();
}
Copy link to clipboard
Copied