Skip to main content
Inspiring
June 9, 2022
Answered

Select all doc text having the same font size as selected text

  • June 9, 2022
  • 1 reply
  • 1019 views

Hi,

it is possible using script to select all other curent document text frames having the same font size?

   scipt →    

This topic has been closed for replies.
Correct answer CarlosCanto

there's a native solution (also in the same uservoice you posted)

 

Select->Same->Font Size Menu

1 reply

siomospAuthor
Inspiring
June 9, 2022

Solved for me, I found a script 🙂

script source

https://illustrator.uservoice.com/forums/333657-illustrator-desktop-feature-requests/suggestions/31533550-select-same-font-size-style-typeface-size

if ((app.activeDocument.selection.length == 1) && (app.activeDocument.selection[0].typename == "TextFrame")) {
var selectedText = app.activeDocument.selection[0];
var textObjects = app.activeDocument.textFrames
var numTextObj = textObjects.length;
for ( j = 0 ; j < numTextObj; j++ ) {
if(textObjects[j].textRange.length > 0 && textObjects[j].editable==true && !textObjects[j].locked && !textObjects[j].hidden ){
if ( selectedText.textRange.characterAttributes.size == textObjects[j].textRange.characterAttributes.size ){
selCValue = selectedText.textRange.characterAttributes.textFont.name ;
txtCValue = textObjects[j].textRange.characterAttributes.textFont.name ;
if (selCValue == txtCValue ) {
textObjects[j].selected = true;
}
}
}
}
} else {
alert ("You must only have a single text object selected");
}

 

m1b
Community Expert
Community Expert
June 9, 2022

Well done! 🙂