Reply To: Alternating Fills

#102308

Do you have a script at the moment that you are having difficulty with and you can share with us, or would you like a complete script written? Please understand that writing complete scripts is the lifeblood of javascripters, so asking for a complete script is usually a task that a scripter would be paid for, unless posters reading this request feel benevolent or are after a challenge.

Jongware wrote a great piece back in the day about tackling tables through scripting: https://creativepro.com/tackling-tables-through-scripting.php

In his article, it highlights how to select a table that the cursor is in (the first part of your question):

function checkWhichTable()
{
// ensure the user made a selection
if (app.selection.length != 1)
return null;
var currentTable = app.selection[0];
if (currentTable.hasOwnProperty(“baseline”))
{
currentTable = app.selection[0].parent;
}
while (currentTable instanceof Cell || currentTable instanceof Row || currentTable instanceof Column)
currentTable = currentTable.parent;
if (!(currentTable instanceof Table))
{
// No table selected
return null;
}
return currentTable;
}

This article was last modified on March 11, 2018

Comments (0)

Loading comments...