how to find the tables only placed on pages.
Hi experts,
I'm finding all the tables in the .indd document (Non XML Indd file.) In that there are some number of tables. And a table in Master page also there. Now I'm trying to get only the tables except the master page. How can I got it?
I used the following code. But it's not working properly.
var myTables=app.activeDocument.stories.everyItem().tables;
app.select(myTables[0]);
var myTableCount=myTables.length;
alert(myTableCount);
for(var i=0;i<myTableCount;i++){
var myTableObj=myTables;
alert(myTableObj.parent);
try
{
var xxx = myTableObj.parent.parentPage.name;
if(xxx.match("^[0-9]+$"))
{
alert("Table");
myTableObj.label="table"+(i+1);
}
else
{
alert("Master-Page Table");
}
}
catch(e)
{
alert(e.message);
}
}
Always throwing catch loop...
Can anyone guide me.................................!
Thanks and Regards,
Vel.