Hi guys,
Yes, I have another question :)
I'm still trying to deal with hundreds of table, and one of the things that highly interests me is the “align on .” feature.
As it would be fairly tedious to align on the decimal . values for hundreds of table, I'm looking for a script.
Peter Kahrel proposes one in his book “scripting in indesign cs3/4 with JS”:
function leftalign_on_unit ()
{
var mySelection = app.selection[0];
if (mySelection.constructor.name != “Cell”) exit ();
// reset justification and insets
mySelection.paragraphs.everyItem().justification = Justification.leftJustified;
mySelection.cells.everyItem().rightInset = 0;
// get horizontal offset of last insertion point in each cell
var myArray = mySelection.cells.everyItem().insertionPoints[-1].horizontalOffset;
// find the biggest value
longest = max_array (myArray);
// get position of left side of column
var myLeftpos = mySelection.cells[0].insertionPoints[0].horizontalOffset;
// set right column margin (right inset) and justi!cation of selection
mySelection.rightInset = mySelection.width – (longest – myLeftpos);
mySelection.paragraphs.everyItem().justification = Justification.rightJustified
}
However, nothing happens when I use it in CS6 (no error, no nothing). I guess it's because this script was written for CS3/4, but I can't figure out what's wrong with it and what should be modified to get it work in CS6… any thoughts?
Thank you very much for your help ;o)
Fred