Find/change table stroke
When using Find/Change and selecting the tab to search for object attributes it's possible to search for a specific stroke width, color etc. But it does not look for that in tables. So if you don't use table or cell formating you have to select and find those attributes by hand. Couldn't there be a tab for searching attributes in tables as well?
-
Saputro Nur commented
Try this. Found it here: http://eugenyus.rudtp.ru/en/list_freescript.php
//(c) Eugenyus, 2012, v1.0, Eugenyusbudantsev@gmail.com
//Поиск-замена толщины контуров ячеек таблицvar talert = "The selection does not contain tables.\nSelect text or frame with tables";
try{var myT = app.activeDocument.selection[0].tables;}catch(e){alert(talert);exit();}
if (myT.length == 0){alert(talert);exit();}
var w = new Window ("dialog","Cells Stroke Weight");
w.alignChildren = "left";
var pan1 = w.add("panel");
pan1.alignChildren = "left";
var pan1g1 = pan1.add("group");
var ft = pan1g1.add("statictext",undefined,"Find: ");
ft.characters = 12;
var findWeight = pan1g1.add("edittext",undefined,"1");
findWeight.characters = 4;
pan1g1.add("statictext",undefined,"pt");
var fAll = pan1g1.add("checkbox",undefined,"All");
fAll.onClick = function(){findWeight.enabled = !fAll.value;}
var pan1g2 = pan1.add("group");
var ct = pan1g2.add("statictext",undefined,"Change To: ");
ct.characters = 12;
var changeWeight = pan1g2.add("edittext",undefined,"0.5");
changeWeight.characters = 4;
pan1g2.add("statictext",undefined,"pt");
var pan2 = w.add("panel",undefined,"Search");
pan2.alignChildren = "left";
var aHor = pan2.add("checkbox",undefined,"Horizontal Lines");
aHor.value = 1;
var aVer = pan2.add("checkbox",undefined,"Vertical Lines");
aVer.value = 1;
var bg = w.add("group");
bg.add("button",undefined,"OK");
bg.add("button",undefined,"Cancel");
if (w.show() != 1){exit();}var fw = Number(findWeight.text.replace(",","."));
var cw = Number(changeWeight.text.replace(",","."));var str = "";
if (aHor.value){
str+="if (myC[j].topEdgeStrokeWeight == "+fw+"){myC[j].topEdgeStrokeWeight = "+cw+";}\r";
str+="if (myC[j].bottomEdgeStrokeWeight == "+fw+"){myC[j].bottomEdgeStrokeWeight = "+cw+";}\r";
}
if (aVer.value){
str+="if (myC[j].leftEdgeStrokeWeight == "+fw+"){myC[j].leftEdgeStrokeWeight = "+cw+";}\r";
str+="if (myC[j].rightEdgeStrokeWeight == "+fw+"){myC[j].rightEdgeStrokeWeight = "+cw+";}\r";
}
if (fAll.value){str = str.replace(/(.+?\{)(.+?)(\})/g,"$2");}for (i=0;i<myT.length;i++){
var myC = myT[i].cells;
for (j=0;j<myC.length;j++){
app.doScript(str,ScriptLanguage.JAVASCRIPT);
}
} -
Kathy Metzer commented
Agreed. This would have been a great time saver for my project.
-
Kostis K. commented
Indeed very much needed.