Hi,
I've taken up learning ExtendScript to tackle some common problems in my workflow.
My current project is to write a scrip that applies white rules to the columns in table heading rows.
So far my script can select the top (heading) row of the appropriate tables. But I can't figure out what the commands are for applying ruling. I've searched through every piece of documentation I could get my hands on, but there doesn't seem to be extensive material written with the beginner in mind.
Here's the script so far (Note: the counter and the alerts are just there so I know everything is working as I go along):
//target the active document
var doc = app.ActiveDoc;
//target the "first" table
var table = doc.FirstTblInDoc;
//number of tables to edit
var numberOfTables = 0;
if(table.ObjectValid() == true)
{
while(table.ObjectValid() == true)
{
if(table.TblTag == "WithHeading")
{
numberOfTables++;
alert("The table '" + table.TblTag.toString() + "' will be edited.");
//select the top row of the table
table.MakeTblSelection(0, 0, 0, table.TblNumRows - 1);
table = table.NextTblInDoc;
}
else
{
alert("The table '" + table.TblTag.toString() + "' will not be edited.");
table = table.NextTblInDoc;
}
}
}
else
{
alert("No more tables.");
}
alert(numberOfTables + " tables will be edited.");