Hi,
In InDesign, is it possible to apply 'Justification.FULLY_JUSTIFIED' to the last line of the paragraph only and not for whole paragraph? The last line have SpecialCharacters.COLUMN_BREAK as a last character.
Thanks.
vDeepak wrote:
In InDesign, is it possible to apply 'Justification.FULLY_JUSTIFIED' to the last line of the paragraph only and not for whole paragraph?
1. No. Justification is a paragraph attribute. But I'm wondering: do you have your entire paragraph flush left, and do you want the last line fully justified? That's an odd combination. Nevertheless, it might be possible to fake it -- increase the tracking on the last line until it fills the entire text frame.
2. Using a script? What version of InDesign and for what language?
There is no built-in option to do what you ask. So what you need to do
is think how you would do this manually with the UI. Once you've got a
procedure for doing it manually, then that procedure can probably be
scripted.
One option is to make the last line a separate paragraph, fully
justified. But this would mean that each paragraph becomes two
paragraphs -- the main bit, and the last line.
Ariel
vDeepak wrote:
In InDesign, is it possible to apply 'Justification.FULLY_JUSTIFIED' to the last line of the paragraph only and not for whole paragraph?
This script will do so, with the text cursor placed inside the paragraph to be spaced out.
par = app.selection[0].paragraphs[0];
lastLine = par.lines.item(-1);
while (lastLine.lines.length == 1)
lastLine.tracking++;
lastLine.tracking--;
... The last line have SpecialCharacters.COLUMN_BREAK as a last character.
The way the paragraph ends is inconsequential to this method. The only thing is, you cannot justify the last line if it only contains a single character. The script will happily attempt to do so but it'll never reach its end condition; instead, it will error out at +10,000 tracking since that seems to be a hardcoded limit.
North America
Europe, Middle East and Africa
Asia Pacific