Skip to main content
Participating Frequently
September 25, 2025
Question

Is it possible (with a script perhaps) to select a range of font sizes?

  • September 25, 2025
  • 1 reply
  • 114 views

Just as one would select a font that's 5pt and perform the operation "Select > Same > Font size" to change them to 6 pt, is it possible to select a range of sizes, as in "5.001pt - 5.999pt" and change all those to 6 pt?

I work on many technical figures with lots of numbers, and manual scaling that's been done before they reach my desk often results in lots of odd font sizes that differ by decimal points. So selecting by font size, as it works currently in the menu, is tedious since they will likely no be all the same. But the numbers are close.

 

Or is there another way to look at this problem? Thank you!

1 reply

RobOctopus
Inspiring
September 25, 2025

yeah, pretty simple to do. just compare the size of a character and if its both below and above specific numbers. you can change to a new number. Here is a very basic code to achieve that. Didn't bother making a nice UI or do any input validation.

 

var BottomNumber = prompt ("enter Bottom Range","5")
var TopNumber = prompt("enter Top Range","6")
var NewNumber = prompt("enter new Point size","")

var allText = app.activeDocument.textFrames
for(var t=0;t<allText.length;t++){
    var thisFrame = allText[t]
    for (var c = 0; c < thisFrame.characters.length; c++) {
        var thisCharacter = thisFrame.characters[c]
        if(thisCharacter.size >= BottomNumber && thisCharacter.size <= TopNumber) thisCharacter.size = NewNumber
    }
}
Participating Frequently
September 26, 2025

Thank you! I'm definintely new to scripting but I'll give this a try. I appreciate it!