Skip to main content
MarinusBarletius
Known Participant
July 16, 2023
Question

Realign all text frames to fit into page master margins

  • July 16, 2023
  • 6 replies
  • 1049 views

I would like to automatically command all of my text boxes to align to the page margins as set up in the page masters. My book has 750 pages, so I do not want to do this manually. See screesnshot. Thank you.

6 replies

Scott Falkner
Community Expert
Community Expert
March 7, 2025

If every page has one and only one text frame and you want that frame on each page to have the same dimentions and posiiton, then:

  • Create an Object Style to define the position and size of the frame,
  • Use Find/Change to apply the Object Style to all text frames. You can then adjust any unwanted frames affected, like titles and page number on the Parent page.

 

Here I created an Object Style that only defines the size and position for a frame…

 

Then I used Find Change to search for any text frame with one column 9that way in can only affect text frames) and apply the “Primary text frame” Object Style.…

 

Good luck

rob day
Community Expert
Community Expert
July 18, 2023

Hi @MarinusBarletius , Are text frames that are mis-aligned overridden master/parent page items that have been moved? An overriden masterpage item that has been repositioned will no longer respond to a position change from the master.

 

If that’s the case, a script could set the overriden text frames’ positions to match the parent page text frame’s position. Something like this:

 

 

 

var tf = app.activeDocument.textFrames.everyItem().getElements()
for (var i = 0; i < tf.length; i++){
    if (tf[i].overridden) {
        tf[i].geometricBounds = tf[i].overriddenMasterPageItem.geometricBounds
    } 
};   

 

 

 

Before and after running the script:

 

Kelli Jae Baeli
Inspiring
March 7, 2025

I tried this script, and nothing happened.

I saved this text of the script into a txt file with an .jsx extension, put it in scripts folder, and then opened scripts panel, saw it there, ran it. What am I doing wrong? I don't usually use scripts, but i have this same problem with some frames on parent pages not matching the margins.

 

Robert at ID-Tasker
Legend
March 7, 2025

@Kelli Jae Baeli

 

Do you use parent page items? 

 

Can you share your document - will be much quicker to diagnose the problem. 

 

If you prefer to do it privately - please click my nickname, but then you'll have to upload your INDD file somewhere first and then send me a link. 

 

Barb Binder
Community Expert
Community Expert
July 18, 2023

Hi @MarinusBarletius:

 

How did you get into this situation? Did you change the margins for the document after you already laid out the text?

 

There is a feature in InDesign called Adjust Layout that instructs the text frames to move with margin changes. If that's how you got here, I think you could simply restore the original margins without Adjust Layout enabled so that the frames again match the frame edges, and then update the margins a second time with Adjust Layout enabled. It's worth a shot.

https://helpx.adobe.com/indesign/using/adjust-layout.html

 

Barb

~Barb at Rocky Mountain Training
Robert at ID-Tasker
Legend
July 18, 2023

If it's one long story - without unlinked objects - you could delete all pages and reflow text again - or just create new document and reflow text there. 

 

Or... if you have ONLY your story on a dedicated layer - you could copy contents of the Story and reflow it on a new layer. 

 

Otherwise - script could do that for you. 

 

Bill Silbert
Community Expert
Community Expert
July 18, 2023

Were all of the text frames originally created using the Parent Pages? If that was the case—and it's just a matter of moving the frames back to their original location—then select all of the document pages in the Pages Panel and use the "Apply Parent to pages..." option in the Pages Panel pull-down menu. In the Apply Parent dialog that comes up choose the option to apply the appropriate Parent Page to all pages.

James Gifford—NitroPress
Legend
July 18, 2023

That doesn't work for me. I've never found a good solution to the OP's problem, especially if any text frames have been resized. It seems to me there is one, but I can't recall how it works.

Bill Silbert
Community Expert
Community Expert
July 18, 2023

My suggestion was based on the possibilty—as unlikely as it probably is—that the document had used a primary text frame and that the only alteration to that frame as it appeared on the document pages was that it had been moved from its original position on each page. In any other scenario applying the Parent page would revert the pages to the configuration of the original Parent Page.

MarinusBarletius
Known Participant
July 18, 2023

Does anyone have any ideas?