win = new Window("dialog", "手动加强对比度（分离灯光和阴影）");
win.orientation = "column";
leftGr = win.add("group");
leftGr.orientation = "column";
baton22 = leftGr.add("group");
Generate = baton22.add("button", undefined, "开始手动加强对比度");
Generate.minimumSize.width = 224;
sliderGroup44 = leftGr.add("group");
sliderGroup44.alignment = "left";
slTxt2 = sliderGroup44.add("staticText", undefined, "开 | 关:");
check00 = sliderGroup44.add("checkbox", undefined);
check00.value = true;
check00.onClick = function() {
    if (check00.value === true) {
        var idslct = charIDToTypeID("slct");
        var desc2240 = new ActionDescriptor();
        var idnull = charIDToTypeID("null");
        var ref1147 = new ActionReference();
        var idLyr = charIDToTypeID("Lyr ");
        ref1147.putName(idLyr, "Manual HRLA");
        desc2240.putReference(idnull, ref1147);
        var idMkVs = charIDToTypeID("MkVs");
        desc2240.putBoolean(idMkVs, false);
        var idLyrI = charIDToTypeID("LyrI");
        var list677 = new ActionList();
        list677.putInteger(76);
        desc2240.putList(idLyrI, list677);
        executeAction(idslct, desc2240, DialogModes.NO);
        var idShw = charIDToTypeID("Shw ");
        var desc2242 = new ActionDescriptor();
        var idnull = charIDToTypeID("null");
        var list679 = new ActionList();
        var ref1149 = new ActionReference();
        var idLyr = charIDToTypeID("Lyr ");
        var idOrdn = charIDToTypeID("Ordn");
        var idTrgt = charIDToTypeID("Trgt");
        ref1149.putEnumerated(idLyr, idOrdn, idTrgt);
        list679.putReference(ref1149);
        desc2242.putList(idnull, list679);
        executeAction(idShw, desc2242, DialogModes.NO);
        app.refresh();
    } else {
        var idslct = charIDToTypeID("slct");
        var desc2240 = new ActionDescriptor();
        var idnull = charIDToTypeID("null");
        var ref1147 = new ActionReference();
        var idLyr = charIDToTypeID("Lyr ");
        ref1147.putName(idLyr, "Manual HRLA");
        desc2240.putReference(idnull, ref1147);
        var idMkVs = charIDToTypeID("MkVs");
        desc2240.putBoolean(idMkVs, false);
        var idLyrI = charIDToTypeID("LyrI");
        var list677 = new ActionList();
        list677.putInteger(76);
        desc2240.putList(idLyrI, list677);
        executeAction(idslct, desc2240, DialogModes.NO);
        var idHd = charIDToTypeID("Hd  ");
        var desc2241 = new ActionDescriptor();
        var idnull = charIDToTypeID("null");
        var list678 = new ActionList();
        var ref1148 = new ActionReference();
        var idLyr = charIDToTypeID("Lyr ");
        var idOrdn = charIDToTypeID("Ordn");
        var idTrgt = charIDToTypeID("Trgt");
        ref1148.putEnumerated(idLyr, idOrdn, idTrgt);
        list678.putReference(ref1148);
        desc2241.putList(idnull, list678);
        executeAction(idHd, desc2241, DialogModes.NO);
        app.refresh();
    }
};
sliderGroup = leftGr.add("group");
sliderGroup.orientation = "row";
sliderGroup.alignChildren = ["fill", "fill"];
sliderGroup.alignment = "left";
slTxt333 = sliderGroup.add("staticText", undefined, "数量：");
slider1 = sliderGroup.add("slider", undefined, 20, 0, 100);
slider1.preferredSize.width = 155;
sliderValue1 = sliderGroup.add("statictext", undefined, "20 ");
sliderGroup = leftGr.add("group");
sliderGroup.orientation = "row";
sliderGroup.alignChildren = ["fill", "fill"];
sliderGroup.alignment = "left";
slTxt3333 = sliderGroup.add("staticText", undefined, "半径：");
slider2 = sliderGroup.add("slider", undefined, 50, 0, 100);
slider2.preferredSize.width = 155;
sliderValue2 = sliderGroup.add("statictext", undefined, "50 ");
sliderGroup = leftGr.add("group");
sliderGroup.orientation = "row";
sliderGroup.alignChildren = ["fill", "fill"];
sliderGroup.alignment = "left";
slTxt3333 = sliderGroup.add("staticText", undefined, "不透明度：");
slider3 = sliderGroup.add("slider", undefined, 100, 0, 100);
slider3.preferredSize.width = 155;
sliderValue3 = sliderGroup.add("statictext", undefined, "100 ");
baton25 = leftGr.add("group");
Generate333 = baton25.add("button", undefined, "反相蒙版");
Generate333.minimumSize.width = 224;
slider1.onChanging = function() {
    sliderValue1.text = Math.round(this.value);
};
slider1.onChange = function() {
    foo1 = Math.round(this.value);
    foo2 = foo1 / 2;
    foo3 = sliderValue2.text;
    var idslct = charIDToTypeID("slct");
    var desc37 = new ActionDescriptor();
    var idnull = charIDToTypeID("null");
    var ref16 = new ActionReference();
    var idLyr = charIDToTypeID("Lyr ");
    ref16.putName(idLyr, "Manual HRLA");
    desc37.putReference(idnull, ref16);
    var idMkVs = charIDToTypeID("MkVs");
    desc37.putBoolean(idMkVs, false);
    executeAction(idslct, desc37, DialogModes.NO);
    var idsetd = charIDToTypeID("setd");
    var desc3 = new ActionDescriptor();
    var idnull = charIDToTypeID("null");
    var ref1 = new ActionReference();
    var idfilterFX = stringIDToTypeID("filterFX");
    ref1.putIndex(idfilterFX, 1);
    var idLyr = charIDToTypeID("Lyr ");
    var idOrdn = charIDToTypeID("Ordn");
    var idTrgt = charIDToTypeID("Trgt");
    ref1.putEnumerated(idLyr, idOrdn, idTrgt);
    desc3.putReference(idnull, ref1);
    var idfilterFX = stringIDToTypeID("filterFX");
    var desc4 = new ActionDescriptor();
    var idFltr = charIDToTypeID("Fltr");
    var desc5 = new ActionDescriptor();
    var idAmnt = charIDToTypeID("Amnt");
    var idPrc = charIDToTypeID("#Prc");
    desc5.putUnitDouble(idAmnt, idPrc, foo2);
    var idRds = charIDToTypeID("Rds ");
    var idPxl = charIDToTypeID("#Pxl");
    desc5.putUnitDouble(idRds, idPxl, foo3);
    var idThsh = charIDToTypeID("Thsh");
    desc5.putInteger(idThsh, 0);
    var idUnsM = charIDToTypeID("UnsM");
    desc4.putObject(idFltr, idUnsM, desc5);
    var idfilterFX = stringIDToTypeID("filterFX");
    desc3.putObject(idfilterFX, idfilterFX, desc4);
    executeAction(idsetd, desc3, DialogModes.NO);
    app.refresh();
};
slider2.onChanging = function() {
    sliderValue2.text = Math.round(this.value);
};
slider2.onChange = function() {
    foo2 = Math.round(this.value);
    foo1 = sliderValue1.text / 2;
    var idslct = charIDToTypeID("slct");
    var desc37 = new ActionDescriptor();
    var idnull = charIDToTypeID("null");
    var ref16 = new ActionReference();
    var idLyr = charIDToTypeID("Lyr ");
    ref16.putName(idLyr, "Manual HRLA");
    desc37.putReference(idnull, ref16);
    var idMkVs = charIDToTypeID("MkVs");
    desc37.putBoolean(idMkVs, false);
    executeAction(idslct, desc37, DialogModes.NO);
    var idsetd = charIDToTypeID("setd");
    var desc3 = new ActionDescriptor();
    var idnull = charIDToTypeID("null");
    var ref1 = new ActionReference();
    var idfilterFX = stringIDToTypeID("filterFX");
    ref1.putIndex(idfilterFX, 1);
    var idLyr = charIDToTypeID("Lyr ");
    var idOrdn = charIDToTypeID("Ordn");
    var idTrgt = charIDToTypeID("Trgt");
    ref1.putEnumerated(idLyr, idOrdn, idTrgt);
    desc3.putReference(idnull, ref1);
    var idfilterFX = stringIDToTypeID("filterFX");
    var desc4 = new ActionDescriptor();
    var idFltr = charIDToTypeID("Fltr");
    var desc5 = new ActionDescriptor();
    var idAmnt = charIDToTypeID("Amnt");
    var idPrc = charIDToTypeID("#Prc");
    desc5.putUnitDouble(idAmnt, idPrc, foo1);
    var idRds = charIDToTypeID("Rds ");
    var idPxl = charIDToTypeID("#Pxl");
    desc5.putUnitDouble(idRds, idPxl, foo2);
    var idThsh = charIDToTypeID("Thsh");
    desc5.putInteger(idThsh, 0);
    var idUnsM = charIDToTypeID("UnsM");
    desc4.putObject(idFltr, idUnsM, desc5);
    var idfilterFX = stringIDToTypeID("filterFX");
    desc3.putObject(idfilterFX, idfilterFX, desc4);
    executeAction(idsetd, desc3, DialogModes.NO);
    app.refresh();
};
Generate.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, "Manual HRLA");
        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, "Manual HRLA - 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);
    }

    function SmartContrast() {
        function step1(enabled, withDialog) {
            if (enabled != undefined && !enabled) {
                return;
            }
            var dialogMode = withDialog ? DialogModes.ALL : DialogModes.NO;
            var desc1 = new ActionDescriptor();
            var ref1 = new ActionReference();
            ref1.putClass(PSClass.Layer);
            desc1.putReference(PSString.Null, ref1);
            desc1.putInteger(PSKey.LayerID, 174);
            executeAction(PSEvent.Make, desc1, dialogMode);
        }

        function step2(enabled, withDialog) {
            if (enabled != undefined && !enabled) {
                return;
            }
            var dialogMode = withDialog ? DialogModes.ALL : DialogModes.NO;
            var desc1 = new ActionDescriptor();
            desc1.putBoolean(PSKey.Duplicate, true);
            executeAction(sTID("mergeVisible"), desc1, dialogMode);
        }

        function step3(enabled, withDialog) {
            if (enabled != undefined && !enabled) {
                return;
            }
            var dialogMode = withDialog ? DialogModes.ALL : DialogModes.NO;
            var desc1 = new ActionDescriptor();
            var ref1 = new ActionReference();
            ref1.putEnumerated(PSClass.Layer, PSType.Ordinal, PSEnum.Target);
            desc1.putReference(PSString.Null, ref1);
            var desc2 = new ActionDescriptor();
            desc2.putString(PSKey.Name, "Manual HRLA");
            desc1.putObject(PSKey.To, PSClass.Layer, desc2);
            executeAction(PSEvent.Set, desc1, dialogMode);
        }

        function step4(enabled, withDialog) {
            if (enabled != undefined && !enabled) {
                return;
            }
            var dialogMode = withDialog ? DialogModes.ALL : DialogModes.NO;
            executeAction(sTID("newPlacedLayer"), undefined, dialogMode);
        }

        function step5(enabled, withDialog) {
            if (enabled != undefined && !enabled) {
                return;
            }
            var dialogMode = withDialog ? DialogModes.ALL : DialogModes.NO;
            var desc1 = new ActionDescriptor();
            desc1.putUnitDouble(PSKey.Amount, PSUnit.Percent, 10);
            desc1.putUnitDouble(PSKey.Radius, PSUnit.Pixels, 50);
            desc1.putInteger(PSKey.Threshold, 0);
            executeAction(sTID("unsharpMask"), desc1, dialogMode);
        }
        step1();
        step2();
        step3();
        step4();
        step5();
    }
    cTID = function(s) {
        return app.charIDToTypeID(s);
    };
    sTID = function(s) {
        return app.stringIDToTypeID(s);
    };
    SmartContrast.loadSymbols = function() {
        var dbgLevel = $.level;
        $.level = 0;
        try {
            PSConstants;
            return;
        } catch (e) {

        } finally {
            $.level = dbgLevel;
        }
        var needDefs = true;
        $.level = 0;
        try {
            PSClass;
            needDefs = false;
        } catch (e) {

        } finally {
            $.level = dbgLevel;
        }
        if (needDefs) {
            PSClass = function() {

            };
            PSEnum = function() {

            };
            PSEvent = function() {

            };
            PSForm = function() {

            };
            PSKey = function() {

            };
            PSType = function() {

            };
            PSUnit = function() {

            };
            PSString = function() {

            };
        }
        PSClass.AdjustmentLayer = cTID("AdjL");
        PSClass.Calculation = cTID("Clcl");
        PSClass.Channel = cTID("Chnl");
        PSClass.CurvesAdjustment = cTID("CrvA");
        PSClass.HueSatAdjustmentV2 = cTID("Hst2");
        PSClass.HueSaturation = cTID("HStr");
        PSClass.LabColorMode = cTID("LbCM");
        PSClass.Layer = cTID("Lyr ");
        PSClass.Mask = cTID("Msk ");
        PSClass.Point = cTID("Pnt ");
        PSEnum.Add = cTID("Add ");
        PSEnum.All = cTID("Al  ");
        PSEnum.AntiAliasNone = cTID("Anno");
        PSEnum.Backward = cTID("Bckw");
        PSEnum.Blue = cTID("Bl  ");
        PSEnum.Composite = cTID("Cmps");
        PSEnum.Difference = cTID("Dfrn");
        PSEnum.ForegroundColor = cTID("FrgC");
        PSEnum.Forward = cTID("Frwr");
        PSEnum.Front = cTID("Frnt");
        PSEnum.HideSelection = cTID("HdSl");
        PSEnum.Lab = cTID("Lab ");
        PSEnum.Merged = cTID("Mrgd");
        PSEnum.Next = cTID("Nxt ");
        PSEnum.Normal = cTID("Nrml");
        PSEnum.Overlay = cTID("Ovrl");
        PSEnum.RGB = cTID("RGB ");
        PSEnum.RevealAll = cTID("RvlA");
        PSEnum.Target = cTID("Trgt");
        PSEvent.Close = cTID("Cls ");
        PSEvent.Copy = cTID("copy");
        PSEvent.Curves = cTID("Crvs");
        PSEvent.Delete = cTID("Dlt ");
        PSEvent.Fill = cTID("Fl  ");
        PSEvent.Hide = cTID("Hd  ");
        PSEvent.Make = cTID("Mk  ");
        PSEvent.Move = cTID("move");
        PSEvent.Paste = cTID("past");
        PSEvent.Rasterize = cTID("Rstr");
        PSEvent.Reset = cTID("Rset");
        PSEvent.Save = cTID("save");
        PSEvent.Select = cTID("slct");
        PSEvent.Set = cTID("setd");
        PSEvent.Show = cTID("Shw ");
        PSKey.Adjustment = cTID("Adjs");
        PSKey.Amount = cTID("Amnt");
        PSKey.AntiAlias = cTID("AntA");
        PSKey.At = cTID("At  ");
        PSKey.Auto = cTID("Auto");
        PSKey.Color = cTID("Clr ");
        PSKey.Colorize = cTID("Clrz");
        PSKey.Colors = cTID("Clrs");
        PSKey.Curve = cTID("Crv ");
        PSKey.Duplicate = cTID("Dplc");
        PSKey.From = cTID("From");
        PSKey.Horizontal = cTID("Hrzn");
        PSKey.Hue = cTID("H   ");
        PSKey.Invert = cTID("Invr");
        PSKey.LayerID = cTID("LyrI");
        PSKey.Lightness = cTID("Lght");
        PSKey.MakeVisible = cTID("MkVs");
        PSKey.Merge = cTID("Mrge");
        PSKey.Mode = cTID("Md  ");
        PSKey.Name = cTID("Nm  ");
        PSKey.New = cTID("Nw  ");
        PSKey.Offset = cTID("Ofst");
        PSKey.Opacity = cTID("Opct");
        PSKey.PreserveTransparency = cTID("PrsT");
        PSKey.Radius = cTID("Rds ");
        PSKey.Scale = cTID("Scl ");
        PSKey.Start = cTID("Strt");
        PSKey.Threshold = cTID("Thsh");
        PSKey.To = cTID("T   ");
        PSKey.Type = cTID("Type");
        PSKey.Using = cTID("Usng");
        PSKey.Vertical = cTID("Vrtc");
        PSKey.With = cTID("With");
        PSString.Null = sTID("null");
        PSString.a = sTID("a");
        PSString.addToSelection = sTID("addToSelection");
        PSString.b = sTID("b");
        PSString.layerGroup = sTID("layerSection");
        PSString.layerGroupEnd = sTID("layerSectionEnd");
        PSString.layerGroupStart = sTID("layerSectionStart");
        PSString.presetKind = sTID("presetKind");
        PSString.presetKindCustom = sTID("presetKindCustom");
        PSString.presetKindDefault = sTID("presetKindDefault");
        PSString.presetKindType = sTID("presetKindType");
        PSString.selection = sTID("selection");
        PSString.selectionModifier = sTID("selectionModifier");
        PSString.selectionModifierType = sTID("selectionModifierType");
        PSType.AntiAlias = cTID("Annt");
        PSType.BlendMode = cTID("BlnM");
        PSType.Calculation = cTID("Clcn");
        PSType.FillContents = cTID("FlCn");
        PSType.Ordinal = cTID("Ordn");
        PSType.UserMaskOptions = cTID("UsrM");
        PSUnit.Percent = cTID("#Prc");
        PSUnit.Pixels = cTID("#Pxl");
    };
    SmartContrast.loadSymbols();
    SmartContrast.main = function() {
        SmartContrast();
    };
    SmartContrast.main();
    var idsetd = charIDToTypeID("setd");
    var desc4 = new ActionDescriptor();
    var idnull = charIDToTypeID("null");
    var ref2 = new ActionReference();
    var idLyr = charIDToTypeID("Lyr ");
    var idOrdn = charIDToTypeID("Ordn");
    var idTrgt = charIDToTypeID("Trgt");
    ref2.putEnumerated(idLyr, idOrdn, idTrgt);
    desc4.putReference(idnull, ref2);
    var idT = charIDToTypeID("T   ");
    var desc5 = new ActionDescriptor();
    var idClr = charIDToTypeID("Clr ");
    var idClr = charIDToTypeID("Clr ");
    var idVlt = charIDToTypeID("Vlt ");
    desc5.putEnumerated(idClr, idClr, idVlt);
    var idLyr = charIDToTypeID("Lyr ");
    desc4.putObject(idT, idLyr, desc5);
    executeAction(idsetd, desc4, DialogModes.NO);
    var idMk = charIDToTypeID("Mk  ");
    var desc6 = new ActionDescriptor();
    var idNw = charIDToTypeID("Nw  ");
    var idChnl = charIDToTypeID("Chnl");
    desc6.putClass(idNw, idChnl);
    var idAt = charIDToTypeID("At  ");
    var ref3 = new ActionReference();
    var idChnl = charIDToTypeID("Chnl");
    var idChnl = charIDToTypeID("Chnl");
    var idMsk = charIDToTypeID("Msk ");
    ref3.putEnumerated(idChnl, idChnl, idMsk);
    desc6.putReference(idAt, ref3);
    var idUsng = charIDToTypeID("Usng");
    var idUsrM = charIDToTypeID("UsrM");
    var idRvlA = charIDToTypeID("RvlA");
    desc6.putEnumerated(idUsng, idUsrM, idRvlA);
    executeAction(idMk, desc6, DialogModes.NO);
    var idslct = charIDToTypeID("slct");
    var desc72 = new ActionDescriptor();
    var idnull = charIDToTypeID("null");
    var ref27 = new ActionReference();
    var idChnl = charIDToTypeID("Chnl");
    var idChnl = charIDToTypeID("Chnl");
    var idfilterMask = stringIDToTypeID("filterMask");
    ref27.putEnumerated(idChnl, idChnl, idfilterMask);
    desc72.putReference(idnull, ref27);
    var idMkVs = charIDToTypeID("MkVs");
    desc72.putBoolean(idMkVs, false);
    executeAction(idslct, desc72, DialogModes.NO);
    var idDlt = charIDToTypeID("Dlt ");
    var desc73 = new ActionDescriptor();
    var idnull = charIDToTypeID("null");
    var ref28 = new ActionReference();
    var idChnl = charIDToTypeID("Chnl");
    var idOrdn = charIDToTypeID("Ordn");
    var idTrgt = charIDToTypeID("Trgt");
    ref28.putEnumerated(idChnl, idOrdn, idTrgt);
    desc73.putReference(idnull, ref28);
    executeAction(idDlt, desc73, DialogModes.NO);
    app.refresh();
};
slider3.onChanging = function() {
    sliderValue3.text = Math.round(this.value);
};
slider3.onChange = function() {
    foo3 = Math.round(this.value);
    var idslct = charIDToTypeID("slct");
    var desc50 = new ActionDescriptor();
    var idnull = charIDToTypeID("null");
    var ref16 = new ActionReference();
    var idLyr = charIDToTypeID("Lyr ");
    ref16.putName(idLyr, "Manual HRLA");
    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);
    var idsetd = charIDToTypeID("setd");
    var desc102 = new ActionDescriptor();
    var idnull = charIDToTypeID("null");
    var ref73 = new ActionReference();
    var idLyr = charIDToTypeID("Lyr ");
    var idOrdn = charIDToTypeID("Ordn");
    var idTrgt = charIDToTypeID("Trgt");
    ref73.putEnumerated(idLyr, idOrdn, idTrgt);
    desc102.putReference(idnull, ref73);
    var idT = charIDToTypeID("T   ");
    var desc103 = new ActionDescriptor();
    var idOpct = charIDToTypeID("Opct");
    var idPrc = charIDToTypeID("#Prc");
    desc103.putUnitDouble(idOpct, idPrc, foo3);
    var idLyr = charIDToTypeID("Lyr ");
    desc102.putObject(idT, idLyr, desc103);
    executeAction(idsetd, desc102, DialogModes.NO);
    app.refresh();
};
Generate333.onClick = function() {
    close = true;
    win.close();
    var idslct = charIDToTypeID("slct");
    var desc50 = new ActionDescriptor();
    var idnull = charIDToTypeID("null");
    var ref16 = new ActionReference();
    var idLyr = charIDToTypeID("Lyr ");
    ref16.putName(idLyr, "Manual HRLA");
    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);
    var idslct = charIDToTypeID("slct");
    var desc51 = new ActionDescriptor();
    var idnull = charIDToTypeID("null");
    var ref17 = new ActionReference();
    var idChnl = charIDToTypeID("Chnl");
    var idChnl = charIDToTypeID("Chnl");
    var idMsk = charIDToTypeID("Msk ");
    ref17.putEnumerated(idChnl, idChnl, idMsk);
    desc51.putReference(idnull, ref17);
    var idMkVs = charIDToTypeID("MkVs");
    desc51.putBoolean(idMkVs, false);
    executeAction(idslct, desc51, DialogModes.NO);
    var idInvr = charIDToTypeID("Invr");
    executeAction(idInvr, undefined, DialogModes.NO);
    var idslct = charIDToTypeID("slct");
    var desc52 = new ActionDescriptor();
    var idnull = charIDToTypeID("null");
    var ref18 = new ActionReference();
    var idPbTl = charIDToTypeID("PbTl");
    ref18.putClass(idPbTl);
    desc52.putReference(idnull, ref18);
    executeAction(idslct, desc52, DialogModes.NO);
    var idRset = charIDToTypeID("Rset");
    var desc165 = new ActionDescriptor();
    var idnull = charIDToTypeID("null");
    var ref79 = new ActionReference();
    var idClr = charIDToTypeID("Clr ");
    var idClrs = charIDToTypeID("Clrs");
    ref79.putProperty(idClr, idClrs);
    desc165.putReference(idnull, ref79);
    executeAction(idRset, desc165, DialogModes.NO);
    app.refresh();
};
closeBtn = leftGr.add("button", undefined, "关闭");
closeBtn.preferredSize.width = 224;
close = false;
closeBtn.onClick = function() {
    close = true;
    win.close();
};
win.onClose = function() {
    close = true;
};
win.show();
while (close === false) {
    app.refresh();
}