Thanks Laubender​ Here the code //DESCRIPTION:Change Table Fills and Strokes // Jongware, 18-Jul-2010 myDialog = app.dialogs.add ({name:"Recolor Tables",canCancel:true}); swatchlist = app.activeDocument.swatches.everyItem().name; with (myDialog) { with (dialogColumns.add()) { with (borderPanels.add()) { staticTexts.add ({staticLabel:"Find"}); swf = dropdowns.add ({stringList:swatchlist, selectedIndex:0}); tbf = percentComboboxes.add({editValue:100, largeNudge:10, stringList:["25", "50", "75", "100"] }); } with (borderPanels.add()) { staticTexts.add ({staticLabel:"Replace"}); swr = dropdowns.add ({stringList:swatchlist, selectedIndex:0}); tbr = percentComboboxes.add({editValue:100, largeNudge:10, stringList:["25", "50", "75", "100"] }); } with (borderPanels.add()) { dostrokes = checkboxControls.add({staticLabel:"Change strokes", checkedState:true}); dofills = checkboxControls.add({staticLabel:"Change fills", checkedState:true}); } } } if (!myDialog.show() || !(dostrokes.checkedState || dofills.checkedState)) { myDialog.destroy(); exit(0); } findtint = tbf.editValue; findswatch = app.activeDocument.swatches.item(swf.selectedIndex); changetint = tbr.editValue; changeswatch = app.activeDocument.swatches.item(swr.selectedIndex); strokes = dostrokes.checkedState; fills = dofills.checkedState; fillchanges = 0; strokechanges = 0; 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++) { if (fills && tab.cells .fillColor == findswatch && tab.cells .fillTint == findtint) { fillchanges++; tab.cells .properties = {fillColor:changeswatch, fillTint:changetint}; } if (strokes) { s = false; if (tab.cells .topEdgeStrokeColor == findswatch && tab.cells .topEdgeStrokeTint == findtint) { s = true; tab.cells .properties = {topEdgeStrokeColor:changeswatch, topEdgeStrokeTint:changetint}; } if (tab.cells .bottomEdgeStrokeColor == findswatch && tab.cells .bottomEdgeStrokeTint == findtint) { s = true; tab.cells .properties = {bottomEdgeStrokeColor:changeswatch, bottomEdgeStrokeTint:changetint}; } if (tab.cells .leftEdgeStrokeColor == findswatch && tab.cells .leftEdgeStrokeTint == findtint) { s = true; tab.cells .properties = {leftEdgeStrokeColor:changeswatch, leftEdgeStrokeTint:changetint}; } if (tab.cells .rightEdgeStrokeColor == findswatch && tab.cells .rightEdgeStrokeTint == findtint) { s = true; tab.cells .properties = {rightEdgeStrokeColor:changeswatch, rightEdgeStrokeTint:changetint}; } if (s) strokechanges++; } } } ch = "No changes made"; if (fillchanges) { ch = fillchanges+" fills changed"; if (strokechanges) ch += "\n"+strokechanges+" strokes changed"; } else if (strokechanges) ch = strokechanges+" strokes changed"; alert (ch);
... View more