-
1. Re: Applying full justification automatically when the last line is almost the width of the frame
DerekC1000 Oct 5, 2014 2:20 PM (in response to Alexander Konovalenko)I wouldn't bother myself, it could be slightly irritating for the reader and it might cause reflow issues if you change some words in a sentence.
More important would be to implement Optical Margin Alignment:
Select the paragraph(s), then from the menu select: Type > Story - select the typesize and tick the checkbox.
-
2. Re: Applying full justification automatically when the last line is almost the width of the frame
rob day Oct 5, 2014 2:37 PM (in response to Alexander Konovalenko)I don't think there's away to do it in the GUI. If you are using OSX try this AppleScript. You would have to be careful with reflows after running this because the changed paragraphs would remain fully justified even if they shouldn't be
---------------------------------------------------
--adjust this to desired percentage. Any last line that's wider than 90% of the column width gets justified
set zone to 0.90
tell application "Adobe InDesign CS6"
set paras to object reference of every paragraph of every story of active document
--check the length of each last line
repeat with x in paras
--get the full column width of the paragraph
set i to horizontal offset of first character of line -2 of x
set j to horizontal offset of last character of line -2 of x
set colw to j - i
--get the last line width
set a to horizontal offset of first character of line -1 of x
set b to horizontal offset of last character of line -1 of x
set lastw to b - a
--if the last line percentage is greater than zone number justify
if lastw / colw is greater than zone then
set justification of x to fully justified
end if
end repeat
end tell
-
4. Re: Applying full justification automatically when the last line is almost the width of the frame
Alexander Konovalenko Oct 5, 2014 11:39 PM (in response to rob day)Thanks Rob. That's exactly what I want to achieve. Unfortunately I use Windows, so I'll probably have to write some JavaScript to automate that. Looking at your script, that doesn't seem as hard as I initially thought.
-
5. Re: Applying full justification automatically when the last line is almost the width of the frame
DerekC1000 Oct 6, 2014 12:05 AM (in response to rob day)Rob - I appreciate that Optical Margin Alignment wouldn't do what Alexander wants, I was merely suggesting that if he's interested in good typographic practice for his novel he might implement this feature.
Derek
-
6. Re: Applying full justification automatically when the last line is almost the width of the frame
rob day Oct 6, 2014 5:48 AM (in response to Alexander Konovalenko)If you know some js it should be easy with the ExtendScript app, or someone in the scripting forum might translate for you. You probably should reset any fully justified paragraphs in the loop via— if justification of x is fully justified then set justification of x to left justified:
---------------------
set zone to 0.95
tell application "Adobe InDesign CS6"
--get all of the document's paragraphs as a list of objects
set paras to object reference of every paragraph of every story of active document
--check the length of each last line
repeat with x in paras
--reset any fully justified paragraphs
if justification of x is fully justified then set justification of x to left justified
--catch any single line paragraphs with try
try
--get the full column width of the paragraph by measuring the 2nd to last line
set i to horizontal offset of first character of line -2 of x
set j to horizontal offset of last character of line -2 of x
set colw to j - i
--get the last line width
set a to horizontal offset of first character of line -1 of x
set b to horizontal offset of last character of line -1 of x
set lastw to b - a
--if the last line percentage is greater than zone number justify
if lastw / colw is greater than zone then
set justification of x to fully justified
end if
end try
end repeat
end tell



