Skip to main content
Participating Frequently
Nov 22, 2026 3:28 AM UTC
Answered

Adjusting hundreds of strokes inside a document

Using Indesign CS 6

Good morning everyone!
I would be pleased when someone is able to help me.
I have written some books with many, many pages (2000 or more). Texts are divided by a single "free” line (stroke). With "free” I mean that the lines are no part of a table or a frame.
The lines are "anchored” inside the texts.
All lines have the same lenght (184 mm), the same thickness (2 mm) and the same color. That makes it a little easier.
I want to make those hundreds of lines a little thinner (e.g. 1,2 mm). To do this by hand will take several days.


Question 1: Is there any script that is able to solve my problem? Or is there any other solution available?


Question 2: (depends on the outcome of question 1) What is the “range” of such a script or solution and is one able to change that? (with “range” I mean that I have to know if the script is working for just a text frame, a page, the whole document etc.).

I thank you for your suggestions, wishing you a good day.

Peter Nugter, Groningen, the Netherlands.

    CORCTON34033231
    CORCTON34033231Correct answer
    Community Expert
    Nov 22, 2026 6:02 AM UTC

    Hi Peter! Good news — no script is needed for this. InDesign can change them all at once with Find/Change for objects:

     

    1. Go to Edit > Find/Change and switch to the Object tab.

    2. Leave the Find what and Change to fields empty. Under Find Format, click the Specify attributes to find icon and set Stroke Weight to 2 mm — and set the Stroke Color to the same colour too, so only these lines are matched. Click OK.

    3. Under Change Format, click the Specify attributes to change icon and set Stroke Weight to 1.2 mm. Click OK.

    4. Set the search scope to Document and click Change All.

     

    That covers the whole document, including the anchored lines, so you don't need to do it page by page. I'd try it on a copy of the file first, just in case any other 2 mm strokes in the document should stay as they are.

    11 replies

    rob day
    Community Expert
    Community Expert
    Nov 24, 2026 6:01 PM UTC

    Hi ​@petern20010557 , Is there a reason you are not using the paragraphs’ Paragraph Rules option? Paragraph Rules can be included in a paragraph style and globally adjusted as needed in a case like this. You might be better off using a script to delete the (anchored?) rectangles and replace them with a Paragraph Rule:

     

     

    Translate
    Participating Frequently
    Nov 24, 2026 9:03 AM UTC

    Dear Mr. Tyson,

    Thank you very much for your quick reply.
    Just one question more ...
    You sent me a script … Thank you very much.
    But what extension does the script need? (vbs, js and so on)
    Can I put the file just in the scripts folder?
    I send you a picture of my "lines” that are in fact rectangles!
    Thanks for the help and wishing you a good day.

     

    Translate
    Community Expert
    Nov 22, 2026 8:01 AM UTC

    Before you us the find change method below - select the first one and make it an Object Style with all your settings. 

    When you do the find change then apply the object style - next time you’ll just need to adjust the object style setting to change them all at the same time.

     

    Translate
    Participating Frequently
    Nov 23, 2026 5:07 AM UTC

    Dear Eugene Tyson,
    I thank you very uch for your quick reply.
    I did not solve my problem as I made a mistake.
    Please, read the reply of your colleague CORCTON34033231 and my reply on his help.
    Thanks again!
    Peter.

    Translate
    CORCTON34033231
    Community Expert
    CORCTON34033231Community ExpertCorrect answer
    Community Expert
    Nov 22, 2026 6:02 AM UTC

    Hi Peter! Good news — no script is needed for this. InDesign can change them all at once with Find/Change for objects:

     

    1. Go to Edit > Find/Change and switch to the Object tab.

    2. Leave the Find what and Change to fields empty. Under Find Format, click the Specify attributes to find icon and set Stroke Weight to 2 mm — and set the Stroke Color to the same colour too, so only these lines are matched. Click OK.

    3. Under Change Format, click the Specify attributes to change icon and set Stroke Weight to 1.2 mm. Click OK.

    4. Set the search scope to Document and click Change All.

     

    That covers the whole document, including the anchored lines, so you don't need to do it page by page. I'd try it on a copy of the file first, just in case any other 2 mm strokes in the document should stay as they are.

    Translate
    Participating Frequently
    Nov 23, 2026 4:49 AM UTC

    Dear Corcton34033231,
    Thank you for your quick reply!
    First of all ...
    I made a mistake!
    The “lines”I woud like to change the height are no lines but small rectangular text frames with the format of 184 mm x 2 mm!
    Of course I tried to change the settings my self in the following way …
    I looked for the options of my 2 mm thick "lines” (but in fact text boxes).
    They gave me the following info under "General”
    Columns: fixed numbers
    Number: 1
    Gutter: 4,233
    Width: 184
    Inset spacing: all zero

    Then with this info I opened Find Object Format options on my first selected "line” and copied the above mentioned values.
    But the problem is that - for some unknown reason - there is no way to fill the height (2 mm) anywhere! So as there is no height I can not change anything form 2 mm to 1,4 mm!
    Height seems to be no part ofthe format options at all!

    So what to do now?

    Related to my question is something else ...
    I remember from earlier times that on forums one could use "Tiny pics” a way to place an image on a foru to make matters more visuable. Is this still possible on this website and is there a website where one can make the necessary URL?

    Thank you again for your appreciated help.

    Peter Nugter.
     

    Translate
    Community Expert
    Nov 23, 2026 6:29 AM UTC

    Thanks for clarifying, Peter.

    That explains why you're not finding the height setting. The options you're looking at are text frame properties, but Find/Change doesn't allow you to search for the physical height of a frame.

    I should also correct my earlier Object Style suggestion. Unfortunately, CS6 doesn't have the Size and Position controls introduced in later versions, so that approach won't solve this particular problem.

    However, a script should be able to do exactly what you need.

    I've put together a small ExtendScript that searches the entire document, including anchored objects, and looks specifically for text frames measuring 184 mm × 2 mm.

    When it finds a match, it changes the height to 1.4 mm while leaving the width unchanged. It also reports how many frames were modified.

    I'd recommend trying it on a duplicate of your document first, particularly given its size, and checking the results before saving. I haven't been able to test it against your actual CS6 document.

    As for screenshots, you don't need TinyPic or another image-hosting website anymore. You can use the Insert Image button in the forum reply editor to upload an image directly.

    Again use a document duplicate and backup your work before running.

    // Resizes text frames approximately 184 mm wide x 2 mm high to 184 mm x 1.4 mm.
    // Processes all page items, including anchored text frames.
    // Run on a duplicate of the document first.

    (function () {
    if (app.documents.length === 0) {
    alert("Please open an InDesign document first.");
    return;
    }

    var doc = app.activeDocument;
    var oldUnit = app.scriptPreferences.measurementUnit;
    var oldWidth = 184;
    var oldHeight = 2;
    var newHeight = 1.4;
    var tolerance = 0.1; // millimetres
    var matched = 0;
    var changed = 0;
    var failed = 0;

    try {
    app.scriptPreferences.measurementUnit = MeasurementUnits.MILLIMETERS;

    // Unlike doc.textFrames, allPageItems includes nested/anchored frames.
    var items = doc.allPageItems;
    for (var i = items.length - 1; i >= 0; i--) {
    var frame = items[i];
    if (!frame.isValid || !(frame instanceof TextFrame)) continue;

    try {
    var b = frame.geometricBounds; // [top, left, bottom, right]
    var width = b[3] - b[1];
    var height = b[2] - b[0];

    if (Math.abs(width - oldWidth) <= tolerance &&
    Math.abs(height - oldHeight) <= tolerance) {
    matched++;
    // Keep the top and horizontal bounds fixed; change only height.
    frame.geometricBounds = [b[0], b[1], b[0] + newHeight, b[3]];
    changed++;
    }
    } catch (e) {
    failed++; // e.g., locked items or frames that cannot be resized
    }
    }
    } finally {
    app.scriptPreferences.measurementUnit = oldUnit;
    }

    alert("Matching text frames: " + matched +
    "\nResized: " + changed +
    "\nCould not process: " + failed +
    "\n\nCheck the document carefully before saving.");
    }());

     

    Translate