Skip to main content
July 29, 2010
Question

Selecting the tables

  • July 29, 2010
  • 2 replies
  • 752 views

Hi All

Can anyone tell me the syntax for selecting the table one by one in a whole Indesign document.

Sajeev

This topic has been closed for replies.

2 replies

Jongware
Community Expert
Community Expert
July 29, 2010

This script will select all tables in the active document, one by one. That's not very useful -- or is it?

for (s=0; s<app.activeDocument.stories.length; s++)
{
for (t=0; t<app.activeDocument.stories.tables.length; t++)
{
  app.activeDocument.stories.tables.select();
}
}
July 29, 2010

Thanks Jongware

It really works great . I have completed the task.

Sajeev

Inspiring
July 29, 2010

There doesn't appear to be any 'tables' collection that's document wide, but you can iterate through all tables in a document like this:

for (var f = 0; f < app.activeDocument.textFrames.length; f++){
     for (var t = 0; t < app.activeDocument.textFrames.tables.length; t++){
          var tempTable = app.activeDocument.textFrames.tables;
     }
}

Community Expert
July 29, 2010

@brettpolo:

Marc Autret showed a wonderful method to change table properties document wide in his blog post "On "everyItem" - Part 2" in the section "Using everyItem().properties":

http://www.indiscripts.com/post/2010/07/on-everyitem-part-2


Don't miss part 1! A must-read for all ExtendScript-scripters…

Uwe

July 30, 2010

Thanks Uwe

I saw the page it really helps me

Sajeev