Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Scripting: How to get page that selected table row is on

Explorer ,
Mar 07, 2020 Mar 07, 2020

I have a table that runs 500 pages.

Is there a way to identify what page any given row is on? Parent returns the page the table starts on.

 

 

511
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 08, 2020 Mar 08, 2020

Hi akiva_atwood ,

I could not find a cleaner way to achieve this, however the following seems to work

rowObj.cells[0].insertionPoints[0].parentTextFrames[0].parentPage.name

 

-Manan

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Oct 19, 2023 Oct 19, 2023
LATEST

That solution works fine, in principle, however, here are two important amendments:

1. If you only need the actual page number, then you could of course use the name, but the "name" can appear multiple times within an InDesign document (different sections). So you have at least to check the section as well. Or you assess the page's "index" and in a second step you find out the actual page number.

2. If the cell overflows, then you don't have a chance to assess any kind of insertion point, baseline etc. simply because this layout information is not present - since not shown on the monitor. What you have to do is to save the "<cell object>.texts[0]" first, then remove it eg using "<cell object>.texts[0].remove()", then assess the insertionPoint[0] plus additional information, and then restore the "<cell object>.texts[0]".

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines