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

Find/Change Specific Tables

New Here ,
Mar 22, 2018 Mar 22, 2018

Copy link to clipboard

Copied

Hello InDesign community,

I have a document with multiple different tables. I want to find and change all occurrences of one of the types of tables. If I use code <0016> in the Find What field under the Text tab, I have to use Find Next to get to each table individually so that I don't remove a different type of table. Is there a way to use this code and specify which tables to change? Or is there another way to do this without having to go one at a time?

Thank you!

TOPICS
Scripting

Views

1.4K

Translate

Translate

Report

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 22, 2018 Mar 22, 2018

Copy link to clipboard

Copied

Hi,
by scripting this is the way to get the special character that constitutes a table: <0016>
The table itself is "embedded" in this character. So if found the table can be accessed by: found[n].texts[0].tables[0] in ExtendScript code where n represents the number of the found text within the array of found text represented by variable found with Text Find.

 

You can search at the InDesign Scripting forum for use cases. There should be some:

InDesign Scripting

Ah! Look for example at this one I wrote a couple of years ago:

Re: Anchoring Tables

 

NOTE: Both links do not work anymore.

Had to edit the code above, because it was damaged when this thread was moved over to the new InDesign forum by the end of 2019.

 

To address all found tables you have to loop through the tableCharacters array of this ExtendScript snippet.
In my example at the beginning of this post I named this array found. In the snippet I linked to its name is tableCharacters.

 

What would you like to do with a table when found?

 

Regards,
Uwe Laubender
( Adobe Community Professional )

 

EDITED

Votes

Translate

Translate

Report

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 ,
Apr 19, 2018 Apr 19, 2018

Copy link to clipboard

Copied

Hi pattig43169899 ,

just a follow-up on addressing tables.

Say, we have 10 tables in one story.

Two of them have 13 columns, all others only 12 or less.

If you want to change something in column 13 of the two tables you could do this in one go:

story.tables.everyItem().columns[12].cells.everyItem().fillColor = "Magenta";

Then you decide, that the fill color of every cell in the last column of all tables in that story should be "Yellow", you could do it with:

story.tables.everyItem().columns[-1].cells.everyItem().fillColor = "Yellow";

Regards,
Uwe

Votes

Translate

Translate

Report

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 ,
Sep 08, 2022 Sep 08, 2022

Copy link to clipboard

Copied

LATEST

Hi together,

also look into my post from today:

 

Why? What? Enter < 0016 > or < 0017 > under the searched text to find the table?
Laubender
https://community.adobe.com/t5/indesign-discussions/why-what-enter-lt-0016-gt-or-lt-0017-gt-under-th...

 

One could refine the search to e.g. tables with 2 or more body rows only if you add <0017> to your Text Find pattern:

<0016><0017>

Or to tables with 3 or more body rows:

<0016><0017><0017>

 

I think, you'll get the pattern…

 

Regards,
Uwe Laubender
( Adobe Community Professional )

Votes

Translate

Translate

Report

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