Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

How do I search/replace text that is not standard size (decimal numbers)?

Explorer ,
Nov 07, 2025 Nov 07, 2025

Hello, I need to search/replace text that is 6.7 pt. It's everywhere in my document, but when I run the search, InDesign can't find it. Are you familiar with this problem, and does anyone have any ideas on how to get around it? Thank you for your help!

TOPICS
Bug , Experiment , Scripting
593
Translate
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

correct answers 1 Correct answer

Community Expert , Nov 07, 2025 Nov 07, 2025

Hi @99drine and others, this is a challenge that comes up from time to time and yes, enforcing stylesheets is the answer, but how do you apply the stylesheet automatically if you can't perform the search for the point size?

 

I've written a script that can solve this particular problem. I tested it on your sample document @99drine and it worked as expected.

 

To use, first perform a normal find/change grep for the target point size: 4.6pt. In the change to field, set the point size also to 4.6pt

...
Translate
Community Expert ,
Nov 07, 2025 Nov 07, 2025

It's working for me in 2025 

 

EugeneTyson_0-1762510684518.png

 

 

Can you share more specifics - or a sample file?

Translate
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
Explorer ,
Nov 07, 2025 Nov 07, 2025

Thank you! Actually, the text I'm looking for is 4.6 pt (sorry). I initially thought that might be the problem, so I tested it with samples, going down to 4.6. InDesign does indeed find the small text. So the problem lies elsewhere... It's extremely strange: when I manually apply the font size in my sample, InDesign finds it, but it doesn't find it in the rest of the text, even though it's supposed to be 4.6 as well... I don't understand! At least, I don't... Do you have any ideas? I'm attaching a sample. Thank you!

 

Translate
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
Community Expert ,
Nov 07, 2025 Nov 07, 2025

Is this happening with just one file or all files? If it only occurs with one file try exporting that file as an IDML (File>Export>InDesign Markup (IDML) and then open that file in your version of InDesign. This process can remove some corruption from a document. If this does not solve the issue please provide details as to what version of InDesign and what operating system that you are using.

Translate
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
Explorer ,
Nov 07, 2025 Nov 07, 2025

Thanks, I'll test it right away and let you know!

 

Translate
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
Explorer ,
Nov 07, 2025 Nov 07, 2025

I just tried that, but unfortunately it didn't solve the problem. OS Ventura 13.6.5, and I tried with InDesign 2024 and then 2026. I'm attaching a sample in idml format. Do you have any other ideas? Thank you!

Translate
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
Community Expert ,
Nov 07, 2025 Nov 07, 2025

Back on my other computer on the Mac with 2023 

Screenshot 2025-11-07 at 11.54.19.png

 

 2025

Screenshot 2025-11-07 at 11.55.15.png

 

 

Seems to be working for me 

 

***************
Can you please share a sample document or screenshots?
***************
Thanks

Translate
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
Explorer ,
Nov 07, 2025 Nov 07, 2025
 
Translate
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
Explorer ,
Nov 07, 2025 Nov 07, 2025

Thank you for your help ! 🙂
Furthermore, it seemed to me that by selecting text (?) you could automatically retrieve its attributes (size, color, font, etc.) to do a search/replace, but I can't figure out how anymore... did I dream it?

Translate
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
Community Expert ,
Nov 07, 2025 Nov 07, 2025

Je ne sais pas ce qui se passe dans ton fichier mais j'ai rencontré le même problème. En sélectionnant le paragraphe de description du « Champi 2 » et en changeant son corps en 4,7, puis de nouveau en 4,6, InDesign l'a trouvé avec un rechercher-remplacer.

Ceci dit, ce serait plus simple de travailler avec des styles de paragraphe.

Capture d’écran 2025-11-07 à 13.39.25.png

Translate
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
Explorer ,
Nov 07, 2025 Nov 07, 2025

Oui, merci, c'est incompréhensible, non ?… et entièrement d'accord pour les feuilles de paragraphe, j'en fais systématiquement… mais là c'est une adaptation, à partir d'un fichier que je n'ai pas créé moi-même… malheureusement ! Merci d'avoir essayé !

Translate
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
Community Expert ,
Nov 07, 2025 Nov 07, 2025

The issue seems to be related to Scaling the text frame. 

 

Here I scaled the text frame by scaling manually with the mouse. 

And it won't find the font size - due to the font size probaby being rounded - and it doesn't show the exact scaled font size. 

EugeneTyson_0-1762528912536.png

 

InDesign is picky with font sizes in Find/Change. The issue is that InDesign stores sizes at a more precise decimal (up to 4 decimal places), but the Find/Change UI only compares exact values. So your text might actually be 4.6003 pt or 4.5978 pt and the UI goes nah, never heard of that.

 

So even though it shows 4.6 pt, it isn’t exactly 4.6 pt inside the file.

 

Maybe frame scaling

Maybe transformations

 

But my test proves it. 

 

So resetting to exactly the font size you need is the best option - rather than manually scaling frames/transforming etc. 

 

And of course, using Styles is far more precise. 

 

Hope that helps.

Translate
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
Explorer ,
Nov 07, 2025 Nov 07, 2025

Thank you very much! I suspected something like that... That would explain why InDesign doesn't recognize the text after scaling... it is indeed a change in format. Thank you for clearing up this mystery! It's a shame that we can't see the decimals precisely or copy and paste or use the eyedropper tool to retrieve the exact characteristics. Thank you for your explanations.

Translate
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
Community Expert ,
Nov 07, 2025 Nov 07, 2025

The issue seems to be related to Scaling the text frame. 

Hi @Eugene Tyson that was my first thought but I don't think that its actually the issue: if you look at @99drine file, it does not seem that the frame has been scaled (the font size would be in parenthesis).

Translate
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
Community Expert ,
Nov 07, 2025 Nov 07, 2025

Only if you have the option turned on in the preferences. 

Translate
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
Community Expert ,
Nov 07, 2025 Nov 07, 2025

Only if you have the option turned on in the preferences. 

Yes of course.

I always untick this option and made a test : I scaled up a text frame (from 12 pt to 15,54) and it worked but it does not work when I scale it down… That's weird!

Translate
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
Community Expert ,
Nov 07, 2025 Nov 07, 2025

I think we've seen this before, and the problem is that the size reported in the panel is rounded to the number you are using, but internally InDesign sees it as the actual value, so doesn't match. As far as I know there's no direct way in the UI to get the actual number, but it might be scriptable.

A forum search might turn up similar threads with a possible solution.

Translate
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
Community Expert ,
Nov 07, 2025 Nov 07, 2025

As @Eugene Tyson suggests, redefining the applied style may be the answer.

Translate
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
Explorer ,
Nov 08, 2025 Nov 08, 2025

Thank you !

Translate
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
Community Expert ,
Nov 07, 2025 Nov 07, 2025

I'm useless for scripting but could a script be used to find text within a certain range? Or could a script be used to round text sizes to two, one, or zero decimal places?

Translate
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
Community Expert ,
Nov 07, 2025 Nov 07, 2025

The exact text size can be detected with a script 

 

// Detection script for ExtendScript (InDesign)
// Select text or a text frame first

if (app.selection.length === 0) {
    alert("Select text or a text frame first");
    exit();
}

var sel = app.selection[0];

// If a frame is selected, use its texts
if (sel.hasOwnProperty("texts")) {
    sel = sel.texts[0];
} else if (!sel.hasOwnProperty("characters")) {
    alert("Selection is not text");
    exit();
}

var chars = sel.characters;
if (chars.length === 0) {
    alert("No characters found");
    exit();
}

var seenMap = {}; // act as set
var seenOrder = []; // keep order for display

for (var i = 0; i < chars.length; i++) {
    var size = chars[i].pointSize;
    if (size === null || size === undefined) {
        // mark inherited sizes explicitly if you want
        if (!seenMap["inherited"]) {
            seenMap["inherited"] = true;
            seenOrder.push("inherited from style");
        }
        continue;
    }
    var s = Number(size).toFixed(6);
    if (!seenMap[s]) {
        seenMap[s] = true;
        seenOrder.push(s);
    }
}

if (seenOrder.length === 0) {
    alert("No explicit sizes found, everything inherits from styles.");
} else {
    alert("Detected sizes:\n\n" + seenOrder.join("\n"));
}
Translate
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
Community Expert ,
Nov 07, 2025 Nov 07, 2025

Thanks @Eugene Tyson 

Translate
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
Explorer ,
Nov 08, 2025 Nov 08, 2025

Thank you for your help !

Translate
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
Community Expert ,
Nov 07, 2025 Nov 07, 2025

Hi @99drine and others, this is a challenge that comes up from time to time and yes, enforcing stylesheets is the answer, but how do you apply the stylesheet automatically if you can't perform the search for the point size?

 

I've written a script that can solve this particular problem. I tested it on your sample document @99drine and it worked as expected.

 

To use, first perform a normal find/change grep for the target point size: 4.6pt. In the change to field, set the point size also to 4.6pt. Then run the script, which perform that change on any text found within POINT_SIZE_THRESHOLD (see script) of the target point size. In my screenshot below I also changed it to blue, so you could see.

 

Let me know if it helps.

- Mark

 

Screenshot 1

demo1.png

 

Screenshot 2demo2.png

 

Screenshot 3

demo3.png

 

/**
 * @file Find/Change Grep Using Fuzzy Point Size.js
 *
 * Usage:
 *   1. Perform an initial find/change grep via the UI
 *      and must include a target point size value, eg. '4.6pt'
 *      (include whatever other criteria for the finding
 *      and changing that you like).
 *   2. Run this script.
 *
 * Will perform the change grep on any text that is
 * within `POINT_SIZE_THRESHOLD` of the target point size.
 * Configure the threshold by editing this script below.
 *
 * @author m1b
 * @version 2025-11-08
 * @discussion https://community.adobe.com/t5/indesign-discussions/how-do-i-search-replace-text-that-is-not-standard-size-decimal-numbers/m-p/15581291
 */
function main() {

    var POINT_SIZE_THRESHOLD = 0.05; // pts

    app.scriptPreferences.measurementUnit = MeasurementUnits.POINTS;

    if (
        undefined == app.findGrepPreferences.pointSize
        || NothingEnum.NOTHING === app.findGrepPreferences.pointSize
    )
        return alert('Please perform an initial find grep for a target point size, eg. "4.6pts".');

    var doc = app.activeDocument;

    // this is the point size we are looking for
    var targetPointSize = app.findGrepPreferences.pointSize;

    // don't specify the point size for this search, we'll check it later
    app.findGrepPreferences.pointSize = NothingEnum.NOTHING;

    var findWhat = app.findGrepPreferences.findWhat
    // find all text
    app.findGrepPreferences.findWhat = '.*';

    // do the find
    var found = doc.findGrep();

    // check point size of each style range
    var counter = 0;
    for (var i = 0, parts; i < found.length; i++) {

        parts = found[i].textStyleRanges;

        partsLoop:
        for (var j = 0; j < parts.length; j++) {

            if (Math.abs(parts[j].pointSize - targetPointSize) > POINT_SIZE_THRESHOLD)
                // size difference is too great, not interested
                continue partsLoop;

            // perform the change as specified earlier via find/change grep UI
            parts[j].changeGrep();
            counter++;

        }

    }

    alert(counter + ' replacement made.');

    // cleanup
    app.findGrepPreferences.pointSize = targetPointSize;
    app.findGrepPreferences.findWhat = findWhat;

};
app.doScript(main, ScriptLanguage.JAVASCRIPT, undefined, UndoModes.ENTIRE_SCRIPT, 'Fuzzy Find/Change');

 

Edit: screenshots for clarity.

Translate
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
Community Expert ,
Nov 07, 2025 Nov 07, 2025

This is great - because I believe it's what happens with indents imported from Word too - should be able to fix all those pesky Word indents to findable now too. 

I do already have a script that detects all the indents and rounds them, which makes them findable, but this is a lot better.

 

This is fantastic.

Translate
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