Skip navigation
Currently Being Moderated

Apply justification for single line in a paragraph

Aug 20, 2012 6:05 AM

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.

 
Replies
  • Currently Being Moderated
    Aug 20, 2012 6:32 AM   in reply to vDeepak

    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?

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 20, 2012 6:38 AM   in reply to vDeepak

    And #1?

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 20, 2012 8:03 AM   in reply to vDeepak

    Do you actually want the entire last line fully justified, or do you

    just want the last word or character in the last line to align flush

    right? If so, you can use a flush space or a right-indent tab.

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 21, 2012 3:46 AM   in reply to vDeepak

    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

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 21, 2012 3:03 PM   in reply to vDeepak

    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.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points