Copy link to clipboard
Copied
I have a 340-page coffee table–style book where all the main text frames must be narrowed <1 mm. Alongside these body text frames, which are always to one side of the page and randomnly alternating which side depending on image compositions, is, an independent second column for occasional editor sidenotes. Basically, the gutter between body and sidenotes is a hair too tight and needs a fraction more space between them. Body text and sidenote frames are both to be narrowed, but more so the body text.
Here's where it gets complex: Unfortunately, the book, labored on now for over a year, was not set up in a conventional manner. Not knowing how to variably control which side of the page that body text would appear on as needed by image compositions, body text frames were independetly placed on each spread, linked together for each chapter, and then shifted left or right as desired. The original text document frames (magenta by default) were never used.
So now a global adustement is hard. Furthermore, no script was learned and applied for the sidenotes. So everyting happens in a highly manual way. The sole upshot is the layout looks pleasing, but is arduous to deal with.
Copy link to clipboard
Copied
Some screenshots showing the layout with guides visible would be helpful.
Copy link to clipboard
Copied
A few examples below:
Copy link to clipboard
Copied
Windows or Mac?
To do it right - it would have to be a two-step process:
1) anchoring all SideNote TextFrames in the Main Text,
2) resizing TextFrames of the Main Text.
Copy link to clipboard
Copied
Windows, and sidenotes are anchored. So all text frames must be resized one-by-one then? As mentioned, body text frames were independetly placed on each spread and linked toether; the original magenta text frames (globally adjustable under Margins and Columns) were never used as a variety of different column placements were needed and these wouldn't follow the same pattern on each spread or page.
Copy link to clipboard
Copied
So if all SideNotes are anchored - the rest would be piece of cake.
Which way do you want to narrow main body TFs? Do you want to update page size as well?
Copy link to clipboard
Copied
No need to update page size at this time (though may be in the cards later), just body text frames narrowed ~2mm from the side. So how to do it globally?
Copy link to clipboard
Copied
I'm away right now so either someone else here will pitch in and create script for you - or I'll do it later today, when I'm back home.
It would help if you could share your document - on priv if you prefer.
Copy link to clipboard
Copied
I haven't used scripts — a learning curve I've yet to begin. So that's the only way? There may be singular advantages to it that may apply to my case. I have individually and manually numbered sidenotes, the text frames issue, and possibly, a need to make adjustments to page size, which affects everything. Not enthusiastic, but perhaps need to get into it.
Copy link to clipboard
Copied
Tailored script will be able to resize TextFrames - no problem at all - you'll have to select one TF of the Story you want to process and specify the value.
Copy link to clipboard
Copied
Hi @Typothalamus , Looks like the justification changes depending on whether the anchor is to the left or right of the body text, so as @Robert at ID-Tasker suggests it should be scriptable. Can you attach an ID file with a few pages
Copy link to clipboard
Copied
I'm not sure @rob day you've understood @Typothalamus requirements - or it's me??
I think he needs to adjust main body TFs - make them narrower - and anchored TFs should stay as they are?
Copy link to clipboard
Copied
Basically, the gutter between body and sidenotes is a hair too tight and needs a fraction more space between them....
make them narrower - and anchored TFs should stay as they are?
If the space between the anchored text frame and the body text frame needs to be larger, making the body frame narrower doesn’t change the gutter space—the anchored frame x position is going to travel with the body frame. I thought it might be helpful to see how the anchors are setup, and what the text alignment is?
So this narrows the body frame by 2mm, but the anchor moves with the frame and the gutter space doesn’t change:
var g = 2;
app.doScript(moveAnchors, ScriptLanguage.JAVASCRIPT, undefined, UndoModes.ENTIRE_SCRIPT, 'Adjust text frames');
function moveAnchors(){
app.scriptPreferences.measurementUnit = MeasurementUnits.MILLIMETERS;
var api = app.activeDocument.allPageItems;
var b, af, sf;
for (var i = 0; i < api.length; i++){
if (api[i].constructor.name == "TextFrame") {
//get the anchored frames
if (api[i].parent.constructor.name == "Character") {
af = api[i];
//the text frame holding the anchor
sf = api[i].parent.parentTextFrames[0];
//the anchored text frames text alignment, if left move the right bound else move the left bound
if (api[i].parentStory.paragraphs[0].justification == Justification.LEFT_ALIGN) {
b = sf.geometricBounds;
sf.geometricBounds = [b[0], b[1], b[2], b[3]-g]
} else {
b = sf.geometricBounds;
sf.geometricBounds = [b[0], b[1]+g, b[2], b[3]]
}
}
}
};
app.scriptPreferences.measurementUnit = AutoEnum.AUTO_VALUE;
}
Before and after:
Copy link to clipboard
Copied
Yeah, you are right. I hate reading and replying on the phone.
Copy link to clipboard
Copied
I think checking the anchored frame’s justification doesn’t work— @Typothalamus has probably set it to Align Away from Spine? Checking where the leftside of the anchor box is in relationship to the body frame might be better:
var g = 2;
app.doScript(moveAnchors, ScriptLanguage.JAVASCRIPT, undefined, UndoModes.ENTIRE_SCRIPT, 'Adjust text frames');
function moveAnchors(){
app.scriptPreferences.measurementUnit = MeasurementUnits.MILLIMETERS;
var api = app.activeDocument.allPageItems;
var b, af, sf, xOff;
for (var i = 0; i < api.length; i++){
if (api[i].constructor.name == "TextFrame") {
//get the anchored frames
if (api[i].parent.constructor.name == "Character") {
af = api[i];
//the text frame holding the anchor
sf = api[i].parent.parentTextFrames[0];
xOff = af.anchoredObjectSettings.anchorXoffset
//Check if the anchored frame is to the left or right of the body frame
if (af.geometricBounds[3] < sf.geometricBounds[1]) {
b = sf.geometricBounds;
sf.geometricBounds = [b[0], b[1]+g, b[2], b[3]]
af.anchoredObjectSettings.anchorXoffset = xOff+g
} else {
b = sf.geometricBounds;
sf.geometricBounds = [b[0], b[1], b[2], b[3]-g]
af.anchoredObjectSettings.anchorXoffset = xOff+g
}
}
}
};
app.scriptPreferences.measurementUnit = AutoEnum.AUTO_VALUE;
}
Copy link to clipboard
Copied
You could perhaps use my free script https://www.id-extras.com/snap-margins-to-text-frame/
Not sure it will work though...
Copy link to clipboard
Copied
@Tá´€W, Unfortunately it won't as @Typothalamus needs to resize TextFrames - not pages.
Copy link to clipboard
Copied
The script readjusts the margins, it doesn't change the page size.
And if there are text frames sitting on the margins (including layouts with 2-column margins), the text frames will be readjusted to snap to the new margins (like the old Layout Adjustment feature that was replaced with the new, and worse, Adjust Layout). So I think this script could be made to do what he needs, although because it's a 2-column layout, I'm not sure if the mirror-margins will work as needed.
Copy link to clipboard
Copied
Oh right, I just glanced over your page, sorry.
Copy link to clipboard
Copied
Very appreciative of the input but this gets more complicated fast, and I'm seeing further ramifications. Let me back up. I still do things rather manually, with, as mentioned, no experience with scripts at all. But I am meticulous about appearance, even if my workflow (as an editor/publisher of print titles dealing with architectural theory in German and English) is, in areas, abominably ineffiencient. I must wear many hats and some areas suffer.
I must convert to Latin before sharing copyrighted content further, but my thinking was just to address one issue (body text frame width) and start there. The margin notes alternate in justification and position, as partially picked up on, but it's complex – they can be to the left or right of the body, left or right page, and justified towards the spine when on the outside of the right page (yet not on the left page) and always away from the spine when on the inside of the page, either page. I wasn't initially attempting to address that through scripting though, and thought I'd be ok with just narrowing all body TFs and manually resetting the notes to create more gutter. Yet the two gutters dividng the page into equal thirds should each be equal.
But it's going to become more complicated and I need to plan ahead. Using a new printer in Asia where I am, and this particular layout, once we get closer to production with the printer, it may need to see inner and outer margins, or margins all around, slightly expanded increasing the format size, depending on how the pages sit in binding. Margins are deliberately a bit tight, but there's a limit and we're verging on it.
So I have this rather intricate sidenote structure and even ~0.5mm between them and the body affect the design's impact. Here, ideally, is what I seek:
1. As you can see in the examples shared, each page's grid, vertically, is basically divided into three main columns. Body text occupies two across, and sidenotes one, regardless which page and with the alternating orientations. I seek to have both of the two gutters each widen by 0.39mm. (Yes, I've tested it and remeausred repeatedly now. Not ~2mm.)
2. I need to be prepared to slightly increase the trim size of the book to widen the margins, if necessary. In ID, I expect this to possibly wreak havoc with the layout and some scripting may be essential to cope.
I'll stop there. Thank you for attempting to help.
Copy link to clipboard
Copied
It's still perfectly doable - but there is no sample attached to your message - here nor on priv.
Copy link to clipboard
Copied
Prepping a sample file with lorem ipsum substituted for copyrighted text and images, but the file size is too large (258MB).
Copy link to clipboard
Copied
ZIP or RAR it and upload to some free sharing service and give us a link.
But first - could you please do SAVE AS with a new name?
And we need only INDD file - no fonts or links - so no full Package.
And please don't send IDML - it will be a pain to open...
Copy link to clipboard
Copied
We don’t need the full document, just do a save as and send a version with 2 or 3 spreads—you can attach ID files to your reply.
Copy link to clipboard
Copied
We don’t need the full document, just do a save as and send a version with 2 or 3 spreads—you can attach ID files to your reply.
By @rob day
You are right but I think a bit bigger sample - at least 10 spreads - would be better in showing all possible "combinations"...