Skip to content

Saputro Nur

My feedback

1 result found

  1. 4 votes

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)

    We’ll send you updates on this idea

    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
    An error occurred while saving the comment
    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);
    }
    }

Feedback and Knowledge Base