Error in fitting dragged table using JavaScript - InDesign CC 2015.4
Hi all,
I have a script for drag, drop and fitting a table. When a normal table is dragged and dropped it fits without any issues. But when I try to drag drop tables of sub-divided rows and columns (super and pivot tables) am getting the following error:
Error String : The property is not applicable in the current state.
Error Line:startPt = mySel.tables
I have mentioned below the script:
//Get the Cell Widths
var cellWidth = new Array(mySel.tables
for( var i = 0; i< mySel.tables
{
if(mySel.tables
{
if(mySel.tables
{
var newWidth;
var startPt,endPt;
newWidth = mySel.tables
mySel.tables
try{
startPt = mySel.tables
endPt = mySel.tables
}
catch(errCode){startPt=0;endPt=0;}
var len = endPt - startPt;
newWidth = newWidth+ len;
cellWidth = newWidth;
}
}
}
//Fit header Column First
for( var i = 0; i< mySel.tables
{
if(mySel.tables
{
if(mySel.tables
{
var newWidth;
var startPt,endPt;
newWidth = mySel.tables
startPt = mySel.tables
//this line shows error
endPt = mySel.tables
var len = endPt - startPt;
newWidth = newWidth+ len;
//mySel.tables
if(mySel.tables
{
newWidth=newWidth*100;
mySel.tables
}
else if(mySel.tables
{
// newWidth=newWidth*10;
mySel.tables
}
}
}
}
Thanks and Regards,
Revathi V