Article View: adobe.scripting.indesign
Article #2492Re: Align Text in a column
From: Dave_Saunders
Date: Wed, 17 Dec 2008 20:41
Date: Wed, 17 Dec 2008 20:41
25 lines
1491 bytes
1491 bytes
This seems to do the job, assuming I've understood correctly:
//DESCRIPTION: Align headings at tops of columns
(function() {
if (app.documents.length > 0 &&
app.selection.length == 1 &&
app.selection[0].hasOwnProperty("parentStory")) {
var aStory = app.selection[0].parentStory;
var textColumns = aStory.textColumns;
for (var j = textColumns.length - 1; j >= 0; j--) {
if (textColumns[j].index != textColumns[j].parentTextFrames[0].texts[0].index) {
// column is on right side of frame
textColumns[j].paragraphs[0].justification = Justification.rightAlign;
} else {
// column is on left side of frame
textColumns[j].paragraphs[0].justification = Justification.leftAlign;
}
}
}
}())
I wrote and tested it for CS4, but I expect it works with any version from CS2 on.
Dave
Technical Details
Message-ID:
<59b74b5e.1@webcrossing.la2eafNXanI>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newshub.sdsu.edu!webcrossingReferences:
<59b74b5e.-1@webcrossing.la2eafNXanI>Show Full Headers
Complete Article Headers
X-Google-Thread: f939a,6ac6eee4e6e6ec1a X-Google-Attributes: gidf939a,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit From: Dave_Saunders@adobeforums.com Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newshub.sdsu.edu!webcrossing Newsgroups: adobe.scripting.indesign Subject: Re: Align Text in a column Message-ID: <59b74b5e.1@webcrossing.la2eafNXanI> Date: Wed, 17 Dec 2008 12:41:58 -0800 References: <59b74b5e.-1@webcrossing.la2eafNXanI> Lines: 31 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit