Skip to main content
bebez71
Known Participant
May 23, 2019
Question

Search/replace color cell stroke

  • May 23, 2019
  • 2 replies
  • 1686 views

I need to find (and replace) where and if a specific color is applied, even in the strokes of a cell/table (which I can't do).

Does a script already exist to do this?

Thanks

This topic has been closed for replies.

2 replies

BarlaeDC
Community Expert
Community Expert
May 24, 2019

Hi,

You should be able to make it one loop by doing something like

allCells = app.activeDocument.stories.everyItem().tables.everyItem().cells.everyItem().getElements();

for ( c =0; c< allCells.length; c++)

{

//// your code here

Regards

Malcolm

bebez71
bebez71Author
Known Participant
May 23, 2019

I've found this thread, the script works, but only on single pages.

Is anyone able to modify it to work on a document with multiple pages?

Quick edits in multiple tables/multiple files

Community Expert
May 23, 2019

Why do you think that this would work on single pages only?

I briefly looked into the code and can see that all stories of the document are targeted:

st = app.activeDocument.stories;

And here the loop goes through all tables of a story in the document:

tb = st.tables;

Regards,
Uwe

bebez71
bebez71Author
Known Participant
May 24, 2019

Many thanks for the reply.

I don't know much about scripts.

Can you help me modify those strings correctly?

---------

I found another thread, but I don't want to change also the stroke thickness, so I've copied a part of that script into the one I had already tried. Now it seems to work.

The other thread is this: Script to find/change stroke in tables

And the good part is this:

tb = app.activeDocument.stories.everyItem().tables.everyItem().getElements();   

for (t=tb.length-1; t>=0; t--)   

{   

  tab = tb;   

  for (c=0; c<tab.cells.length; c++)