Show font-size

New Here ,
Dec 19, 2021 Dec 19, 2021

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();

}

 

orys30406838_0-1639973607889.png

 

TOPICS
Scripting

Views

38

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Dec 19, 2021 Dec 19, 2021

Copy link to clipboard

Copied

LATEST

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines