Copy link to clipboard
Copied
Hi all,
I'm doing a book. Some of the left-justified paragraphs are so close to the right margin that I would prefer them to full-justify. I'm doing this manually, is there a tool/script/preference that I can use/activate to full justify text when over 95% of the text frame length?
Thank you a lot
If you mean that when the last line of a paragraph almost reaches the right-hand side of the text area, you want the paragraph the full align -- no, InDesign doesn't have a ready tool for this, you'd have to ask someone to write a script for you.
Copy link to clipboard
Copied
Copy link to clipboard
Copied
I think she's pretty clear on her request. If the body style is Justify, you get paragraphs where there's just a bit of left-end space. That may look ragged although it's not usually a composition flaw. Another style can make that paragraph Full Justify, but it would be tedious to keep doing so throughout a layout cycle.
Not sure if a GREP style could do this. Sounds like a job for Script-O-Man, who ain't me. 🙂
Copy link to clipboard
Copied
Thank you.
I'll have to find a Script-O-Man 😄
Copy link to clipboard
Copied
Yes, of course. But this doesn't come up in paragraph styles, nor anywhere in InDesign apparently 🙂
Thank you for replying
Copy link to clipboard
Copied
If you mean that when the last line of a paragraph almost reaches the right-hand side of the text area, you want the paragraph the full align -- no, InDesign doesn't have a ready tool for this, you'd have to ask someone to write a script for you.
Copy link to clipboard
Copied
Thank you!
Any suggestion where I can ask that from someone? 🙂
Copy link to clipboard
Copied
Here in this forum there are people who write custom scripts, and if you offer to pay a fee you'll get more response, probably.
Copy link to clipboard
Copied
One problem with doing it manually is when the text reflows you might not want the fully justified paragraph anymore. You can try this script which will reset all of the document’s fully justified paragraphs to left justified, before fully justifying paragraphs where the last line is over 90% of the measure. You would have to rerun the script after any text edits:
//the justification zone as a percentage
var jzone = 90;
var p, eho, fr;
for(var i=0; i < app.activeDocument.stories.length; i++){
var s = app.activeDocument.stories.item(i);
for(var j=0; j < s.paragraphs.length; j++){
p=s.paragraphs.item(j);
//reset any fully justified paragraph to left justified
if (p.justification == 1718971500) {
p.justification = 1818915700
}
eho = p.characters[-1].endHorizontalOffset;
fr = p.characters[-1].parentTextFrames[0].geometricBounds;
if (eho/fr[3]*100 > jzone) {
p.justification = 1718971500
}
}
}