win = new Window("dialog", "HDR 工具");
win.orientation = "column";
b1L = 200;
b2L = 83;
s1L = 165;
s2L = 142;
s3L = 142;
leftGr = win.add("group");
leftGr.orientation = "column";
baton259 = leftGr.add("group");
Generate555 = baton259.add("button", undefined, "开始 HDR ");
Generate555.preferredSize.width = b1L;
baton289 = leftGr.add("group");
Generate5555 = baton289.add("button", undefined, "删除");
Generate5555.preferredSize.width = b1L;
Generate5555.onClick = function() {
    var idDlt = charIDToTypeID("Dlt ");
    var desc217 = new ActionDescriptor();
    var idnull = charIDToTypeID("null");
    var ref99 = new ActionReference();
    var idLyr = charIDToTypeID("Lyr ");
    var idOrdn = charIDToTypeID("Ordn");
    var idTrgt = charIDToTypeID("Trgt");
    ref99.putEnumerated(idLyr, idOrdn, idTrgt);
    desc217.putReference(idnull, ref99);
    var idLyrI = charIDToTypeID("LyrI");
    var list58 = new ActionList();
    list58.putInteger(41);
    desc217.putList(idLyrI, list58);
    executeAction(idDlt, desc217, DialogModes.NO);
    alert("HDR已删除");
    app.refresh();
};
Generate555.onClick = function() {
    if (app) {
        try {
            MainCatch3();
        } catch (e) {

        }
    }

    function MainCatch3() {
        var getName = app.activeDocument.activeLayer.name;
        var idslct = charIDToTypeID("slct");
        var desc410 = new ActionDescriptor();
        var idnull = charIDToTypeID("null");
        var ref300 = new ActionReference();
        var idLyr = charIDToTypeID("Lyr ");
        ref300.putName(idLyr, "HDR Kit");
        desc410.putReference(idnull, ref300);
        var idMkVs = charIDToTypeID("MkVs");
        desc410.putBoolean(idMkVs, false);
        var idLyrI = charIDToTypeID("LyrI");
        var list239 = new ActionList();
        list239.putInteger(94);
        desc410.putList(idLyrI, list239);
        executeAction(idslct, desc410, DialogModes.NO);
        var idsetd = charIDToTypeID("setd");
        var desc422 = new ActionDescriptor();
        var idnull = charIDToTypeID("null");
        var ref309 = new ActionReference();
        var idLyr = charIDToTypeID("Lyr ");
        var idOrdn = charIDToTypeID("Ordn");
        var idTrgt = charIDToTypeID("Trgt");
        ref309.putEnumerated(idLyr, idOrdn, idTrgt);
        desc422.putReference(idnull, ref309);
        var idT = charIDToTypeID("T   ");
        var desc423 = new ActionDescriptor();
        var idNm = charIDToTypeID("Nm  ");
        desc423.putString(idNm, "HDR Kit - old");
        var idLyr = charIDToTypeID("Lyr ");
        desc422.putObject(idT, idLyr, desc423);
        executeAction(idsetd, desc422, DialogModes.NO);
        var idsetd = charIDToTypeID("setd");
        var desc86 = new ActionDescriptor();
        var idnull = charIDToTypeID("null");
        var ref54 = new ActionReference();
        var idLyr = charIDToTypeID("Lyr ");
        var idOrdn = charIDToTypeID("Ordn");
        var idTrgt = charIDToTypeID("Trgt");
        ref54.putEnumerated(idLyr, idOrdn, idTrgt);
        desc86.putReference(idnull, ref54);
        var idT = charIDToTypeID("T   ");
        var desc87 = new ActionDescriptor();
        var idClr = charIDToTypeID("Clr ");
        var idClr = charIDToTypeID("Clr ");
        var idNone = charIDToTypeID("None");
        desc87.putEnumerated(idClr, idClr, idNone);
        var idLyr = charIDToTypeID("Lyr ");
        desc86.putObject(idT, idLyr, desc87);
        executeAction(idsetd, desc86, DialogModes.NO);
        var idslct = charIDToTypeID("slct");
        var desc410 = new ActionDescriptor();
        var idnull = charIDToTypeID("null");
        var ref300 = new ActionReference();
        var idLyr = charIDToTypeID("Lyr ");
        ref300.putName(idLyr, getName);
        desc410.putReference(idnull, ref300);
        var idMkVs = charIDToTypeID("MkVs");
        desc410.putBoolean(idMkVs, false);
        var idLyrI = charIDToTypeID("LyrI");
        var list239 = new ActionList();
        list239.putInteger(94);
        desc410.putList(idLyrI, list239);
        executeAction(idslct, desc410, DialogModes.NO);
        app.refresh();
    }
    var idMk = charIDToTypeID("Mk  ");
    var desc11 = new ActionDescriptor();
    var idnull = charIDToTypeID("null");
    var ref9 = new ActionReference();
    var idLyr = charIDToTypeID("Lyr ");
    ref9.putClass(idLyr);
    desc11.putReference(idnull, ref9);
    executeAction(idMk, desc11, DialogModes.NO);
    var idMrgV = charIDToTypeID("MrgV");
    var desc12 = new ActionDescriptor();
    var idDplc = charIDToTypeID("Dplc");
    desc12.putBoolean(idDplc, true);
    executeAction(idMrgV, desc12, DialogModes.NO);
    var idsetd = charIDToTypeID("setd");
    var desc13 = new ActionDescriptor();
    var idnull = charIDToTypeID("null");
    var ref10 = new ActionReference();
    var idLyr = charIDToTypeID("Lyr ");
    var idOrdn = charIDToTypeID("Ordn");
    var idTrgt = charIDToTypeID("Trgt");
    ref10.putEnumerated(idLyr, idOrdn, idTrgt);
    desc13.putReference(idnull, ref10);
    var idT = charIDToTypeID("T   ");
    var desc14 = new ActionDescriptor();
    var idNm = charIDToTypeID("Nm  ");
    desc14.putString(idNm, "HDR Kit");
    var idLyr = charIDToTypeID("Lyr ");
    desc13.putObject(idT, idLyr, desc14);
    executeAction(idsetd, desc13, DialogModes.NO);
    var idnewPlacedLayer = stringIDToTypeID("newPlacedLayer");
    executeAction(idnewPlacedLayer, undefined, DialogModes.NO);
    var idsetd = charIDToTypeID("setd");
    var desc124 = new ActionDescriptor();
    var idnull = charIDToTypeID("null");
    var ref91 = new ActionReference();
    var idLyr = charIDToTypeID("Lyr ");
    var idOrdn = charIDToTypeID("Ordn");
    var idTrgt = charIDToTypeID("Trgt");
    ref91.putEnumerated(idLyr, idOrdn, idTrgt);
    desc124.putReference(idnull, ref91);
    var idT = charIDToTypeID("T   ");
    var desc125 = new ActionDescriptor();
    var idClr = charIDToTypeID("Clr ");
    var idClr = charIDToTypeID("Clr ");
    var idBl = charIDToTypeID("Bl  ");
    desc125.putEnumerated(idClr, idClr, idBl);
    var idLyr = charIDToTypeID("Lyr ");
    desc124.putObject(idT, idLyr, desc125);
    executeAction(idsetd, desc124, DialogModes.NO);
    var idadaptCorrect = stringIDToTypeID("adaptCorrect");
    var desc15 = new ActionDescriptor();
    var idsdwM = charIDToTypeID("sdwM");
    var desc16 = new ActionDescriptor();
    var idAmnt = charIDToTypeID("Amnt");
    var idPrc = charIDToTypeID("#Prc");
    desc16.putUnitDouble(idAmnt, idPrc, 30);
    var idWdth = charIDToTypeID("Wdth");
    var idPrc = charIDToTypeID("#Prc");
    desc16.putUnitDouble(idWdth, idPrc, 40);
    var idRds = charIDToTypeID("Rds ");
    desc16.putInteger(idRds, 50);
    var idadaptCorrectTones = stringIDToTypeID("adaptCorrectTones");
    desc15.putObject(idsdwM, idadaptCorrectTones, desc16);
    var idhglM = charIDToTypeID("hglM");
    var desc17 = new ActionDescriptor();
    var idAmnt = charIDToTypeID("Amnt");
    var idPrc = charIDToTypeID("#Prc");
    desc17.putUnitDouble(idAmnt, idPrc, 30);
    var idWdth = charIDToTypeID("Wdth");
    var idPrc = charIDToTypeID("#Prc");
    desc17.putUnitDouble(idWdth, idPrc, 40);
    var idRds = charIDToTypeID("Rds ");
    desc17.putInteger(idRds, 50);
    var idadaptCorrectTones = stringIDToTypeID("adaptCorrectTones");
    desc15.putObject(idhglM, idadaptCorrectTones, desc17);
    var idBlcC = charIDToTypeID("BlcC");
    desc15.putDouble(idBlcC, 0.01);
    var idWhtC = charIDToTypeID("WhtC");
    desc15.putDouble(idWhtC, 0.01);
    var idCntr = charIDToTypeID("Cntr");
    desc15.putInteger(idCntr, 25);
    var idClrC = charIDToTypeID("ClrC");
    desc15.putInteger(idClrC, 20);
    executeAction(idadaptCorrect, desc15, DialogModes.NO);
    var idslct = charIDToTypeID("slct");
    var desc20 = new ActionDescriptor();
    var idnull = charIDToTypeID("null");
    var ref15 = new ActionReference();
    var idChnl = charIDToTypeID("Chnl");
    var idChnl = charIDToTypeID("Chnl");
    var idfilterMask = stringIDToTypeID("filterMask");
    ref15.putEnumerated(idChnl, idChnl, idfilterMask);
    desc20.putReference(idnull, ref15);
    var idMkVs = charIDToTypeID("MkVs");
    desc20.putBoolean(idMkVs, false);
    executeAction(idslct, desc20, DialogModes.NO);
    var idDlt = charIDToTypeID("Dlt ");
    var desc21 = new ActionDescriptor();
    var idnull = charIDToTypeID("null");
    var ref16 = new ActionReference();
    var idChnl = charIDToTypeID("Chnl");
    var idOrdn = charIDToTypeID("Ordn");
    var idTrgt = charIDToTypeID("Trgt");
    ref16.putEnumerated(idChnl, idOrdn, idTrgt);
    desc21.putReference(idnull, ref16);
    executeAction(idDlt, desc21, DialogModes.NO);
    app.refresh();
};
sliderGroup447 = leftGr.add("group");
sliderGroup447.alignment = "left";
slTxt22 = sliderGroup447.add("staticText", undefined, "中间值对比度");
sliderGroup = leftGr.add("group");
sliderF = sliderGroup.add("slider", undefined, 25, 0, 100);
sliderF.preferredSize.width = s1L;
sliderValueF = sliderGroup.add("statictext", undefined, " 25 ");
sliderGroup44 = leftGr.add("group");
sliderGroup44.alignment = "left";
slTxt2 = sliderGroup44.add("staticText", undefined, "阴影：");
sliderGroup = leftGr.add("group");
sliderGroup.orientation = "row";
sliderGroup.alignChildren = ["fill", "fill"];
slTxt3 = sliderGroup.add("staticText", undefined, "数量：");
sliderA = sliderGroup.add("slider", undefined, 30, 0, 100);
sliderA.preferredSize.width = s3L;
sliderValueA = sliderGroup.add("statictext", undefined, " 30 ");
sliderA.onChanging = function() {
    sliderValueA.text = Math.round(this.value);
};
sliderA.onChange = function() {
    fooB = sliderValueB.text;
    foo2 = fooB * 2;
    fooD = sliderValueD.text;
    foo3 = fooD * 2;
    foo = Math.round(this.value);
    var idslct = charIDToTypeID("slct");
    var desc25 = new ActionDescriptor();
    var idnull = charIDToTypeID("null");
    var ref18 = new ActionReference();
    var idLyr = charIDToTypeID("Lyr ");
    ref18.putName(idLyr, "HDR Kit");
    desc25.putReference(idnull, ref18);
    var idMkVs = charIDToTypeID("MkVs");
    desc25.putBoolean(idMkVs, false);
    executeAction(idslct, desc25, DialogModes.NO);
    var idsetd = charIDToTypeID("setd");
    var desc26 = new ActionDescriptor();
    var idnull = charIDToTypeID("null");
    var ref19 = new ActionReference();
    var idfilterFX = stringIDToTypeID("filterFX");
    ref19.putIndex(idfilterFX, 1);
    var idLyr = charIDToTypeID("Lyr ");
    var idOrdn = charIDToTypeID("Ordn");
    var idTrgt = charIDToTypeID("Trgt");
    ref19.putEnumerated(idLyr, idOrdn, idTrgt);
    desc26.putReference(idnull, ref19);
    var idfilterFX = stringIDToTypeID("filterFX");
    var desc27 = new ActionDescriptor();
    var idFltr = charIDToTypeID("Fltr");
    var desc28 = new ActionDescriptor();
    var idsdwM = charIDToTypeID("sdwM");
    var desc29 = new ActionDescriptor();
    var idAmnt = charIDToTypeID("Amnt");
    var idPrc = charIDToTypeID("#Prc");
    desc29.putUnitDouble(idAmnt, idPrc, foo);
    var idWdth = charIDToTypeID("Wdth");
    var idPrc = charIDToTypeID("#Prc");
    desc29.putUnitDouble(idWdth, idPrc, sliderValueBB.text);
    var idRds = charIDToTypeID("Rds ");
    desc29.putInteger(idRds, foo2);
    var idadaptCorrectTones = stringIDToTypeID("adaptCorrectTones");
    desc28.putObject(idsdwM, idadaptCorrectTones, desc29);
    var idhglM = charIDToTypeID("hglM");
    var desc30 = new ActionDescriptor();
    var idAmnt = charIDToTypeID("Amnt");
    var idPrc = charIDToTypeID("#Prc");
    desc30.putUnitDouble(idAmnt, idPrc, sliderValueC.text);
    var idWdth = charIDToTypeID("Wdth");
    var idPrc = charIDToTypeID("#Prc");
    desc30.putUnitDouble(idWdth, idPrc, sliderValueCC.text);
    var idRds = charIDToTypeID("Rds ");
    desc30.putInteger(idRds, foo3);
    var idadaptCorrectTones = stringIDToTypeID("adaptCorrectTones");
    desc28.putObject(idhglM, idadaptCorrectTones, desc30);
    var idBlcC = charIDToTypeID("BlcC");
    desc28.putDouble(idBlcC, 0.01);
    var idWhtC = charIDToTypeID("WhtC");
    desc28.putDouble(idWhtC, 0.01);
    var idCntr = charIDToTypeID("Cntr");
    desc28.putInteger(idCntr, sliderValueF.text);
    var idClrC = charIDToTypeID("ClrC");
    desc28.putInteger(idClrC, 20);
    var idadaptCorrect = stringIDToTypeID("adaptCorrect");
    desc27.putObject(idFltr, idadaptCorrect, desc28);
    var idfilterFX = stringIDToTypeID("filterFX");
    desc26.putObject(idfilterFX, idfilterFX, desc27);
    executeAction(idsetd, desc26, DialogModes.NO);
    app.refresh();
};
sliderGroup = leftGr.add("group");
sliderGroup.orientation = "row";
sliderGroup.alignChildren = ["fill", "fill"];
slTxt33 = sliderGroup.add("staticText", undefined, "色调：");
sliderBB = sliderGroup.add("slider", undefined, 50, 0, 100);
sliderBB.preferredSize.width = s3L;
sliderValueBB = sliderGroup.add("statictext", undefined, " 50 ");
sliderBB.onChanging = function() {
    sliderValueBB.text = Math.round(this.value);
};
sliderBB.onChange = function() {
    fooB = sliderValueB.text;
    foo2 = fooB * 2;
    fooD = sliderValueD.text;
    foo3 = fooD * 2;
    foo = Math.round(this.value);
    var idslct = charIDToTypeID("slct");
    var desc25 = new ActionDescriptor();
    var idnull = charIDToTypeID("null");
    var ref18 = new ActionReference();
    var idLyr = charIDToTypeID("Lyr ");
    ref18.putName(idLyr, "HDR Kit");
    desc25.putReference(idnull, ref18);
    var idMkVs = charIDToTypeID("MkVs");
    desc25.putBoolean(idMkVs, false);
    executeAction(idslct, desc25, DialogModes.NO);
    var idsetd = charIDToTypeID("setd");
    var desc26 = new ActionDescriptor();
    var idnull = charIDToTypeID("null");
    var ref19 = new ActionReference();
    var idfilterFX = stringIDToTypeID("filterFX");
    ref19.putIndex(idfilterFX, 1);
    var idLyr = charIDToTypeID("Lyr ");
    var idOrdn = charIDToTypeID("Ordn");
    var idTrgt = charIDToTypeID("Trgt");
    ref19.putEnumerated(idLyr, idOrdn, idTrgt);
    desc26.putReference(idnull, ref19);
    var idfilterFX = stringIDToTypeID("filterFX");
    var desc27 = new ActionDescriptor();
    var idFltr = charIDToTypeID("Fltr");
    var desc28 = new ActionDescriptor();
    var idsdwM = charIDToTypeID("sdwM");
    var desc29 = new ActionDescriptor();
    var idAmnt = charIDToTypeID("Amnt");
    var idPrc = charIDToTypeID("#Prc");
    desc29.putUnitDouble(idAmnt, idPrc, sliderValueA.text);
    var idWdth = charIDToTypeID("Wdth");
    var idPrc = charIDToTypeID("#Prc");
    desc29.putUnitDouble(idWdth, idPrc, foo);
    var idRds = charIDToTypeID("Rds ");
    desc29.putInteger(idRds, foo2);
    var idadaptCorrectTones = stringIDToTypeID("adaptCorrectTones");
    desc28.putObject(idsdwM, idadaptCorrectTones, desc29);
    var idhglM = charIDToTypeID("hglM");
    var desc30 = new ActionDescriptor();
    var idAmnt = charIDToTypeID("Amnt");
    var idPrc = charIDToTypeID("#Prc");
    desc30.putUnitDouble(idAmnt, idPrc, sliderValueC.text);
    var idWdth = charIDToTypeID("Wdth");
    var idPrc = charIDToTypeID("#Prc");
    desc30.putUnitDouble(idWdth, idPrc, sliderValueCC.text);
    var idRds = charIDToTypeID("Rds ");
    desc30.putInteger(idRds, foo3);
    var idadaptCorrectTones = stringIDToTypeID("adaptCorrectTones");
    desc28.putObject(idhglM, idadaptCorrectTones, desc30);
    var idBlcC = charIDToTypeID("BlcC");
    desc28.putDouble(idBlcC, 0.01);
    var idWhtC = charIDToTypeID("WhtC");
    desc28.putDouble(idWhtC, 0.01);
    var idCntr = charIDToTypeID("Cntr");
    desc28.putInteger(idCntr, sliderValueF.text);
    var idClrC = charIDToTypeID("ClrC");
    desc28.putInteger(idClrC, 20);
    var idadaptCorrect = stringIDToTypeID("adaptCorrect");
    desc27.putObject(idFltr, idadaptCorrect, desc28);
    var idfilterFX = stringIDToTypeID("filterFX");
    desc26.putObject(idfilterFX, idfilterFX, desc27);
    executeAction(idsetd, desc26, DialogModes.NO);
    app.refresh();
};
sliderGroup = leftGr.add("group");
sliderGroup.orientation = "row";
sliderGroup.alignChildren = ["fill", "fill"];
slTxt333 = sliderGroup.add("staticText", undefined, "半径：");
sliderB = sliderGroup.add("slider", undefined, 20, 0, 100);
sliderB.preferredSize.width = s3L;
sliderValueB = sliderGroup.add("statictext", undefined, " 20 ");
sliderB.onChanging = function() {
    sliderValueB.text = Math.round(this.value);
};
sliderB.onChange = function() {
    foo = Math.round(this.value);
    foo2 = foo * 2;
    fooD = sliderValueD.text;
    foo3 = fooD * 2;
    var idslct = charIDToTypeID("slct");
    var desc25 = new ActionDescriptor();
    var idnull = charIDToTypeID("null");
    var ref18 = new ActionReference();
    var idLyr = charIDToTypeID("Lyr ");
    ref18.putName(idLyr, "HDR Kit");
    desc25.putReference(idnull, ref18);
    var idMkVs = charIDToTypeID("MkVs");
    desc25.putBoolean(idMkVs, false);
    executeAction(idslct, desc25, DialogModes.NO);
    var idsetd = charIDToTypeID("setd");
    var desc26 = new ActionDescriptor();
    var idnull = charIDToTypeID("null");
    var ref19 = new ActionReference();
    var idfilterFX = stringIDToTypeID("filterFX");
    ref19.putIndex(idfilterFX, 1);
    var idLyr = charIDToTypeID("Lyr ");
    var idOrdn = charIDToTypeID("Ordn");
    var idTrgt = charIDToTypeID("Trgt");
    ref19.putEnumerated(idLyr, idOrdn, idTrgt);
    desc26.putReference(idnull, ref19);
    var idfilterFX = stringIDToTypeID("filterFX");
    var desc27 = new ActionDescriptor();
    var idFltr = charIDToTypeID("Fltr");
    var desc28 = new ActionDescriptor();
    var idsdwM = charIDToTypeID("sdwM");
    var desc29 = new ActionDescriptor();
    var idAmnt = charIDToTypeID("Amnt");
    var idPrc = charIDToTypeID("#Prc");
    desc29.putUnitDouble(idAmnt, idPrc, sliderValueA.text);
    var idWdth = charIDToTypeID("Wdth");
    var idPrc = charIDToTypeID("#Prc");
    desc29.putUnitDouble(idWdth, idPrc, sliderValueBB.text);
    var idRds = charIDToTypeID("Rds ");
    desc29.putInteger(idRds, foo2);
    var idadaptCorrectTones = stringIDToTypeID("adaptCorrectTones");
    desc28.putObject(idsdwM, idadaptCorrectTones, desc29);
    var idhglM = charIDToTypeID("hglM");
    var desc30 = new ActionDescriptor();
    var idAmnt = charIDToTypeID("Amnt");
    var idPrc = charIDToTypeID("#Prc");
    desc30.putUnitDouble(idAmnt, idPrc, sliderValueC.text);
    var idWdth = charIDToTypeID("Wdth");
    var idPrc = charIDToTypeID("#Prc");
    desc30.putUnitDouble(idWdth, idPrc, sliderValueCC.text);
    var idRds = charIDToTypeID("Rds ");
    desc30.putInteger(idRds, foo3);
    var idadaptCorrectTones = stringIDToTypeID("adaptCorrectTones");
    desc28.putObject(idhglM, idadaptCorrectTones, desc30);
    var idBlcC = charIDToTypeID("BlcC");
    desc28.putDouble(idBlcC, 0.01);
    var idWhtC = charIDToTypeID("WhtC");
    desc28.putDouble(idWhtC, 0.01);
    var idCntr = charIDToTypeID("Cntr");
    desc28.putInteger(idCntr, sliderValueF.text);
    var idClrC = charIDToTypeID("ClrC");
    desc28.putInteger(idClrC, 20);
    var idadaptCorrect = stringIDToTypeID("adaptCorrect");
    desc27.putObject(idFltr, idadaptCorrect, desc28);
    var idfilterFX = stringIDToTypeID("filterFX");
    desc26.putObject(idfilterFX, idfilterFX, desc27);
    executeAction(idsetd, desc26, DialogModes.NO);
    app.refresh();
};
sliderGroup444 = leftGr.add("group");
sliderGroup444.alignment = "left";
slTxt22 = sliderGroup444.add("staticText", undefined, "高光：");
sliderGroup = leftGr.add("group");
sliderGroup.orientation = "row";
sliderGroup.alignChildren = ["fill", "fill"];
slTxt336 = sliderGroup.add("staticText", undefined, "数量：");
sliderC = sliderGroup.add("slider", undefined, 30, 0, 100);
sliderC.preferredSize.width = s3L;
sliderValueC = sliderGroup.add("statictext", undefined, " 30 ");
sliderC.onChanging = function() {
    sliderValueC.text = Math.round(this.value);
};
sliderC.onChange = function() {
    fooB = sliderValueB.text;
    foo2 = fooB * 2;
    fooD = sliderValueD.text;
    foo3 = fooD * 2;
    foo = Math.round(this.value);
    var idslct = charIDToTypeID("slct");
    var desc25 = new ActionDescriptor();
    var idnull = charIDToTypeID("null");
    var ref18 = new ActionReference();
    var idLyr = charIDToTypeID("Lyr ");
    ref18.putName(idLyr, "HDR Kit");
    desc25.putReference(idnull, ref18);
    var idMkVs = charIDToTypeID("MkVs");
    desc25.putBoolean(idMkVs, false);
    executeAction(idslct, desc25, DialogModes.NO);
    var idsetd = charIDToTypeID("setd");
    var desc26 = new ActionDescriptor();
    var idnull = charIDToTypeID("null");
    var ref19 = new ActionReference();
    var idfilterFX = stringIDToTypeID("filterFX");
    ref19.putIndex(idfilterFX, 1);
    var idLyr = charIDToTypeID("Lyr ");
    var idOrdn = charIDToTypeID("Ordn");
    var idTrgt = charIDToTypeID("Trgt");
    ref19.putEnumerated(idLyr, idOrdn, idTrgt);
    desc26.putReference(idnull, ref19);
    var idfilterFX = stringIDToTypeID("filterFX");
    var desc27 = new ActionDescriptor();
    var idFltr = charIDToTypeID("Fltr");
    var desc28 = new ActionDescriptor();
    var idsdwM = charIDToTypeID("sdwM");
    var desc29 = new ActionDescriptor();
    var idAmnt = charIDToTypeID("Amnt");
    var idPrc = charIDToTypeID("#Prc");
    desc29.putUnitDouble(idAmnt, idPrc, sliderValueA.text);
    var idWdth = charIDToTypeID("Wdth");
    var idPrc = charIDToTypeID("#Prc");
    desc29.putUnitDouble(idWdth, idPrc, sliderValueBB.text);
    var idRds = charIDToTypeID("Rds ");
    desc29.putInteger(idRds, foo2);
    var idadaptCorrectTones = stringIDToTypeID("adaptCorrectTones");
    desc28.putObject(idsdwM, idadaptCorrectTones, desc29);
    var idhglM = charIDToTypeID("hglM");
    var desc30 = new ActionDescriptor();
    var idAmnt = charIDToTypeID("Amnt");
    var idPrc = charIDToTypeID("#Prc");
    desc30.putUnitDouble(idAmnt, idPrc, foo);
    var idWdth = charIDToTypeID("Wdth");
    var idPrc = charIDToTypeID("#Prc");
    desc30.putUnitDouble(idWdth, idPrc, sliderValueCC.text);
    var idRds = charIDToTypeID("Rds ");
    desc30.putInteger(idRds, foo3);
    var idadaptCorrectTones = stringIDToTypeID("adaptCorrectTones");
    desc28.putObject(idhglM, idadaptCorrectTones, desc30);
    var idBlcC = charIDToTypeID("BlcC");
    desc28.putDouble(idBlcC, 0.01);
    var idWhtC = charIDToTypeID("WhtC");
    desc28.putDouble(idWhtC, 0.01);
    var idCntr = charIDToTypeID("Cntr");
    desc28.putInteger(idCntr, sliderValueF.text);
    var idClrC = charIDToTypeID("ClrC");
    desc28.putInteger(idClrC, 20);
    var idadaptCorrect = stringIDToTypeID("adaptCorrect");
    desc27.putObject(idFltr, idadaptCorrect, desc28);
    var idfilterFX = stringIDToTypeID("filterFX");
    desc26.putObject(idfilterFX, idfilterFX, desc27);
    executeAction(idsetd, desc26, DialogModes.NO);
    app.refresh();
};
sliderGroup = leftGr.add("group");
sliderGroup.orientation = "row";
sliderGroup.alignChildren = ["fill", "fill"];
slTxt335 = sliderGroup.add("staticText", undefined, "色调：");
sliderCC = sliderGroup.add("slider", undefined, 50, 0, 100);
sliderCC.preferredSize.width = s3L;
sliderValueCC = sliderGroup.add("statictext", undefined, " 50 ");
sliderCC.onChanging = function() {
    sliderValueCC.text = Math.round(this.value);
};
sliderCC.onChange = function() {
    foo = Math.round(this.value);
    fooB = sliderValueB.text;
    foo2 = fooB * 2;
    fooD = sliderValueD.text;
    foo3 = fooD * 2;
    var idslct = charIDToTypeID("slct");
    var desc25 = new ActionDescriptor();
    var idnull = charIDToTypeID("null");
    var ref18 = new ActionReference();
    var idLyr = charIDToTypeID("Lyr ");
    ref18.putName(idLyr, "HDR Kit");
    desc25.putReference(idnull, ref18);
    var idMkVs = charIDToTypeID("MkVs");
    desc25.putBoolean(idMkVs, false);
    executeAction(idslct, desc25, DialogModes.NO);
    var idsetd = charIDToTypeID("setd");
    var desc26 = new ActionDescriptor();
    var idnull = charIDToTypeID("null");
    var ref19 = new ActionReference();
    var idfilterFX = stringIDToTypeID("filterFX");
    ref19.putIndex(idfilterFX, 1);
    var idLyr = charIDToTypeID("Lyr ");
    var idOrdn = charIDToTypeID("Ordn");
    var idTrgt = charIDToTypeID("Trgt");
    ref19.putEnumerated(idLyr, idOrdn, idTrgt);
    desc26.putReference(idnull, ref19);
    var idfilterFX = stringIDToTypeID("filterFX");
    var desc27 = new ActionDescriptor();
    var idFltr = charIDToTypeID("Fltr");
    var desc28 = new ActionDescriptor();
    var idsdwM = charIDToTypeID("sdwM");
    var desc29 = new ActionDescriptor();
    var idAmnt = charIDToTypeID("Amnt");
    var idPrc = charIDToTypeID("#Prc");
    desc29.putUnitDouble(idAmnt, idPrc, sliderValueA.text);
    var idWdth = charIDToTypeID("Wdth");
    var idPrc = charIDToTypeID("#Prc");
    desc29.putUnitDouble(idWdth, idPrc, sliderValueBB.text);
    var idRds = charIDToTypeID("Rds ");
    desc29.putInteger(idRds, foo2);
    var idadaptCorrectTones = stringIDToTypeID("adaptCorrectTones");
    desc28.putObject(idsdwM, idadaptCorrectTones, desc29);
    var idhglM = charIDToTypeID("hglM");
    var desc30 = new ActionDescriptor();
    var idAmnt = charIDToTypeID("Amnt");
    var idPrc = charIDToTypeID("#Prc");
    desc30.putUnitDouble(idAmnt, idPrc, sliderValueC.text);
    var idWdth = charIDToTypeID("Wdth");
    var idPrc = charIDToTypeID("#Prc");
    desc30.putUnitDouble(idWdth, idPrc, foo);
    var idRds = charIDToTypeID("Rds ");
    desc30.putInteger(idRds, foo3);
    var idadaptCorrectTones = stringIDToTypeID("adaptCorrectTones");
    desc28.putObject(idhglM, idadaptCorrectTones, desc30);
    var idBlcC = charIDToTypeID("BlcC");
    desc28.putDouble(idBlcC, 0.01);
    var idWhtC = charIDToTypeID("WhtC");
    desc28.putDouble(idWhtC, 0.01);
    var idCntr = charIDToTypeID("Cntr");
    desc28.putInteger(idCntr, sliderValueF.text);
    var idClrC = charIDToTypeID("ClrC");
    desc28.putInteger(idClrC, 20);
    var idadaptCorrect = stringIDToTypeID("adaptCorrect");
    desc27.putObject(idFltr, idadaptCorrect, desc28);
    var idfilterFX = stringIDToTypeID("filterFX");
    desc26.putObject(idfilterFX, idfilterFX, desc27);
    executeAction(idsetd, desc26, DialogModes.NO);
    app.refresh();
};
sliderGroup = leftGr.add("group");
sliderGroup.orientation = "row";
sliderGroup.alignChildren = ["fill", "fill"];
slTxt334 = sliderGroup.add("staticText", undefined, "半径：");
sliderD = sliderGroup.add("slider", undefined, 20, 0, 100);
sliderD.preferredSize.width = s2L;
sliderValueD = sliderGroup.add("statictext", undefined, " 20 ");
sliderD.onChanging = function() {
    sliderValueD.text = Math.round(this.value);
};
sliderD.onChange = function() {
    foo = Math.round(this.value);
    foo2 = foo * 2;
    fooB = sliderValueB.text;
    foo3 = fooB * 2;
    var idslct = charIDToTypeID("slct");
    var desc25 = new ActionDescriptor();
    var idnull = charIDToTypeID("null");
    var ref18 = new ActionReference();
    var idLyr = charIDToTypeID("Lyr ");
    ref18.putName(idLyr, "HDR Kit");
    desc25.putReference(idnull, ref18);
    var idMkVs = charIDToTypeID("MkVs");
    desc25.putBoolean(idMkVs, false);
    executeAction(idslct, desc25, DialogModes.NO);
    var idsetd = charIDToTypeID("setd");
    var desc26 = new ActionDescriptor();
    var idnull = charIDToTypeID("null");
    var ref19 = new ActionReference();
    var idfilterFX = stringIDToTypeID("filterFX");
    ref19.putIndex(idfilterFX, 1);
    var idLyr = charIDToTypeID("Lyr ");
    var idOrdn = charIDToTypeID("Ordn");
    var idTrgt = charIDToTypeID("Trgt");
    ref19.putEnumerated(idLyr, idOrdn, idTrgt);
    desc26.putReference(idnull, ref19);
    var idfilterFX = stringIDToTypeID("filterFX");
    var desc27 = new ActionDescriptor();
    var idFltr = charIDToTypeID("Fltr");
    var desc28 = new ActionDescriptor();
    var idsdwM = charIDToTypeID("sdwM");
    var desc29 = new ActionDescriptor();
    var idAmnt = charIDToTypeID("Amnt");
    var idPrc = charIDToTypeID("#Prc");
    desc29.putUnitDouble(idAmnt, idPrc, sliderValueA.text);
    var idWdth = charIDToTypeID("Wdth");
    var idPrc = charIDToTypeID("#Prc");
    desc29.putUnitDouble(idWdth, idPrc, sliderValueBB.text);
    var idRds = charIDToTypeID("Rds ");
    desc29.putInteger(idRds, foo3);
    var idadaptCorrectTones = stringIDToTypeID("adaptCorrectTones");
    desc28.putObject(idsdwM, idadaptCorrectTones, desc29);
    var idhglM = charIDToTypeID("hglM");
    var desc30 = new ActionDescriptor();
    var idAmnt = charIDToTypeID("Amnt");
    var idPrc = charIDToTypeID("#Prc");
    desc30.putUnitDouble(idAmnt, idPrc, sliderValueC.text);
    var idWdth = charIDToTypeID("Wdth");
    var idPrc = charIDToTypeID("#Prc");
    desc30.putUnitDouble(idWdth, idPrc, sliderValueCC.text);
    var idRds = charIDToTypeID("Rds ");
    desc30.putInteger(idRds, foo2);
    var idadaptCorrectTones = stringIDToTypeID("adaptCorrectTones");
    desc28.putObject(idhglM, idadaptCorrectTones, desc30);
    var idBlcC = charIDToTypeID("BlcC");
    desc28.putDouble(idBlcC, 0.01);
    var idWhtC = charIDToTypeID("WhtC");
    desc28.putDouble(idWhtC, 0.01);
    var idCntr = charIDToTypeID("Cntr");
    desc28.putInteger(idCntr, sliderValueF.text);
    var idClrC = charIDToTypeID("ClrC");
    desc28.putInteger(idClrC, 20);
    var idadaptCorrect = stringIDToTypeID("adaptCorrect");
    desc27.putObject(idFltr, idadaptCorrect, desc28);
    var idfilterFX = stringIDToTypeID("filterFX");
    desc26.putObject(idfilterFX, idfilterFX, desc27);
    executeAction(idsetd, desc26, DialogModes.NO);
    app.refresh();
};
sliderF.onChanging = function() {
    sliderValueF.text = Math.round(this.value);
};
sliderF.onChange = function() {
    foo = Math.round(this.value);
    fooB = sliderValueB.text;
    foo2 = fooB * 2;
    fooD = sliderValueD.text;
    foo3 = fooD * 2;
    var idslct = charIDToTypeID("slct");
    var desc25 = new ActionDescriptor();
    var idnull = charIDToTypeID("null");
    var ref18 = new ActionReference();
    var idLyr = charIDToTypeID("Lyr ");
    ref18.putName(idLyr, "HDR Kit");
    desc25.putReference(idnull, ref18);
    var idMkVs = charIDToTypeID("MkVs");
    desc25.putBoolean(idMkVs, false);
    executeAction(idslct, desc25, DialogModes.NO);
    var idsetd = charIDToTypeID("setd");
    var desc26 = new ActionDescriptor();
    var idnull = charIDToTypeID("null");
    var ref19 = new ActionReference();
    var idfilterFX = stringIDToTypeID("filterFX");
    ref19.putIndex(idfilterFX, 1);
    var idLyr = charIDToTypeID("Lyr ");
    var idOrdn = charIDToTypeID("Ordn");
    var idTrgt = charIDToTypeID("Trgt");
    ref19.putEnumerated(idLyr, idOrdn, idTrgt);
    desc26.putReference(idnull, ref19);
    var idfilterFX = stringIDToTypeID("filterFX");
    var desc27 = new ActionDescriptor();
    var idFltr = charIDToTypeID("Fltr");
    var desc28 = new ActionDescriptor();
    var idsdwM = charIDToTypeID("sdwM");
    var desc29 = new ActionDescriptor();
    var idAmnt = charIDToTypeID("Amnt");
    var idPrc = charIDToTypeID("#Prc");
    desc29.putUnitDouble(idAmnt, idPrc, sliderValueA.text);
    var idWdth = charIDToTypeID("Wdth");
    var idPrc = charIDToTypeID("#Prc");
    desc29.putUnitDouble(idWdth, idPrc, sliderValueBB.text);
    var idRds = charIDToTypeID("Rds ");
    desc29.putInteger(idRds, foo2);
    var idadaptCorrectTones = stringIDToTypeID("adaptCorrectTones");
    desc28.putObject(idsdwM, idadaptCorrectTones, desc29);
    var idhglM = charIDToTypeID("hglM");
    var desc30 = new ActionDescriptor();
    var idAmnt = charIDToTypeID("Amnt");
    var idPrc = charIDToTypeID("#Prc");
    desc30.putUnitDouble(idAmnt, idPrc, sliderValueC.text);
    var idWdth = charIDToTypeID("Wdth");
    var idPrc = charIDToTypeID("#Prc");
    desc30.putUnitDouble(idWdth, idPrc, sliderValueCC.text);
    var idRds = charIDToTypeID("Rds ");
    desc30.putInteger(idRds, foo3);
    var idadaptCorrectTones = stringIDToTypeID("adaptCorrectTones");
    desc28.putObject(idhglM, idadaptCorrectTones, desc30);
    var idBlcC = charIDToTypeID("BlcC");
    desc28.putDouble(idBlcC, 0.01);
    var idWhtC = charIDToTypeID("WhtC");
    desc28.putDouble(idWhtC, 0.01);
    var idCntr = charIDToTypeID("Cntr");
    desc28.putInteger(idCntr, foo);
    var idClrC = charIDToTypeID("ClrC");
    desc28.putInteger(idClrC, 20);
    var idadaptCorrect = stringIDToTypeID("adaptCorrect");
    desc27.putObject(idFltr, idadaptCorrect, desc28);
    var idfilterFX = stringIDToTypeID("filterFX");
    desc26.putObject(idfilterFX, idfilterFX, desc27);
    executeAction(idsetd, desc26, DialogModes.NO);
    app.refresh();
};
baton255 = leftGr.add("group");
Generate777 = baton255.add("button", undefined, "隐藏图层 | 显示图层");
Generate777.preferredSize.width = b1L;
Generate777.onClick = function() {
    var idslct = charIDToTypeID("slct");
    var desc50 = new ActionDescriptor();
    var idnull = charIDToTypeID("null");
    var ref16 = new ActionReference();
    var idLyr = charIDToTypeID("Lyr ");
    ref16.putName(idLyr, "HDR Kit");
    desc50.putReference(idnull, ref16);
    var idMkVs = charIDToTypeID("MkVs");
    desc50.putBoolean(idMkVs, false);
    var idLyrI = charIDToTypeID("LyrI");
    var list2 = new ActionList();
    list2.putInteger(4);
    desc50.putList(idLyrI, list2);
    executeAction(idslct, desc50, DialogModes.NO);
    if (app.activeDocument.activeLayer.visible) {
        var idHd = charIDToTypeID("Hd  ");
        var desc136 = new ActionDescriptor();
        var idnull = charIDToTypeID("null");
        var list29 = new ActionList();
        var ref57 = new ActionReference();
        var idLyr = charIDToTypeID("Lyr ");
        var idOrdn = charIDToTypeID("Ordn");
        var idTrgt = charIDToTypeID("Trgt");
        ref57.putEnumerated(idLyr, idOrdn, idTrgt);
        list29.putReference(ref57);
        desc136.putList(idnull, list29);
        executeAction(idHd, desc136, DialogModes.NO);
        app.refresh();
    } else {
        var idShw = charIDToTypeID("Shw ");
        var desc137 = new ActionDescriptor();
        var idnull = charIDToTypeID("null");
        var list30 = new ActionList();
        var ref58 = new ActionReference();
        var idLyr = charIDToTypeID("Lyr ");
        var idOrdn = charIDToTypeID("Ordn");
        var idTrgt = charIDToTypeID("Trgt");
        ref58.putEnumerated(idLyr, idOrdn, idTrgt);
        list30.putReference(ref58);
        desc137.putList(idnull, list30);
        executeAction(idShw, desc137, DialogModes.NO);
        app.refresh();
    }
};
closeBtn = leftGr.add("button", undefined, "关闭");
closeBtn.preferredSize.width = b1L;
close = false;
closeBtn.onClick = function() {
    close = true;
    win.close();
};
win.onClose = function() {
    close = true;
};
win.show();
while (close === false) {
    app.refresh();
}