Clear Overrides with .jsx
Hi
New to scripting. I have the following which means cells within a table which have a paragraph style on them will be changed to a cell style. It works perfectly EXCEPT it will not clear overrides in the table.
I understand there is some more script I should add in to make that happen? But I can't work out what or where.
Please help!
function findTable(obj)
{
while (obj.constructor.name != "Table")
{
obj = obj.parent;
if (obj.constructor.name == "Application")
{
throw "Can’t find table";
}
}
return obj;
}
var myTable = 0;
if (app.documents.length > 0 && app.selection.length > 0)
{
myTable = findTable(app.selection[0]);
//Find styles cells formater
if (myTable.constructor.name == "Table")
{
app.findTextPreferences = app.changeTextPreferences = NothingEnum.nothing;
app.findTextPreferences.appliedParagraphStyle = "Heading 2";
var myCellStyle = myTable.findText();
app.findTextPreferences = app.changeTextPreferences = NothingEnum.nothing;
}
if (myCellStyle.length > 0)
{
for (var c = 0; c < myCellStyle.length; c++)
{
myCellStyle
}
} else
{
alert("Not found");
}
}