Copy link to clipboard
Copied
Hi there
I have a large table that spans many pages in overflowing to different text frames.
How can i tell which page a row is on.. i have tried the following
function PageRowIsOn(row) //yes i do correctly pass a table row
{
var table = row.parent;
var frame = table.parent;
var pageIndex= frame.parent.index;
return pageIndex;
}
but it always returns 0.
So i was wondering if someone can point me in a better direction
cheers
Buzz
Hi Arivu,
Your code will give you wrong page no. if your table continued on next page.
Just select one row of reflowed table on second page and run your code. It will give you page no. from which page table is start.
This code work well if you have selected a row.
row.cells[0].texts[0].parentTextFrames[0].parent.name
Shonky
Copy link to clipboard
Copied
try this code: return row.cells[0].texts[0].parentTextFrames[0].parent.name (or index)
Copy link to clipboard
Copied
Try the below code return the page object
function getPage(theObj)
{
if (theObj.constructor.name == "Page") return theObj;
if (theObj.constructor.name == "Character")
return getPage(theObj.parentTextFrames[0]);
if (theObj.constructor.name == "Application")
{
// Frame is on an unexpected place...
alert ("Can't able to find the page");
//exit(0);
}
return getPage(theObj.parent);
}
Arivu
Copy link to clipboard
Copied
Hi Arivu,
Your code will give you wrong page no. if your table continued on next page.
Just select one row of reflowed table on second page and run your code. It will give you page no. from which page table is start.
This code work well if you have selected a row.
row.cells[0].texts[0].parentTextFrames[0].parent.name
Shonky
Find more inspiration, events, and resources on the new Adobe Community
Explore Now