win = new Window("dialog", "快速修饰 2");
win.orientation = "column";
b1L = 195;
b2L = 83;
s1L = 155;
s2L = 115;
s3L = 115;
leftGr = win.add("group");
leftGr.orientation = "column";
baton259 = leftGr.add("group");
baton259.alignment = "left";
Generate555 = baton259.add("button", undefined, "开始 | + 缩放");
Generate555.preferredSize.width = b1L;
if (app) {
    try {
        MainCatch555();
    } catch (e) {

    }
}

function MainCatch555() {
    var getNameLayerMask = app.activeDocument.activeLayer.name;
    if (getNameLayerMask = "Mask") {
        var idslct = charIDToTypeID("slct");
        var desc1257 = new ActionDescriptor();
        var idnull = charIDToTypeID("null");
        var ref614 = new ActionReference();
        var idChnl = charIDToTypeID("Chnl");
        var idChnl = charIDToTypeID("Chnl");
        var idRGB = charIDToTypeID("RGB ");
        ref614.putEnumerated(idChnl, idChnl, idRGB);
        desc1257.putReference(idnull, ref614);
        var idMkVs = charIDToTypeID("MkVs");
        desc1257.putBoolean(idMkVs, false);
        executeAction(idslct, desc1257, DialogModes.NO);
        var idslct = charIDToTypeID("slct");
        var desc1258 = new ActionDescriptor();
        var idnull = charIDToTypeID("null");
        var ref615 = new ActionReference();
        var idChnl = charIDToTypeID("Chnl");
        var idChnl = charIDToTypeID("Chnl");
        var idMsk = charIDToTypeID("Msk ");
        ref615.putEnumerated(idChnl, idChnl, idMsk);
        desc1258.putReference(idnull, ref615);
        var idMkVs = charIDToTypeID("MkVs");
        desc1258.putBoolean(idMkVs, false);
        executeAction(idslct, desc1258, DialogModes.NO);
    }
}
Generate555.onClick = function() {
    if (app) {
        try {
            MainCatch3();
        } catch (e) {

        }
    }

    function MainCatch3() {
        if (ScriptUI.environment.keyboardState.shiftKey) {
            function CRAuto() {
                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.putEnumerated(PSClass.MenuItem, PSType.MenuItem, PSEnum.ZoomIn);
                    desc1.putReference(PSString.Null, ref1);
                    executeAction(PSEvent.Select, desc1, dialogMode);
                }
                step1();
            }
            cTID = function(s) {
                return app.charIDToTypeID(s);
            };
            sTID = function(s) {
                return app.stringIDToTypeID(s);
            };
            CRAuto.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.MenuItem = cTID("Mn  ");
                PSEnum.ZoomIn = cTID("ZmIn");
                PSEvent.Select = cTID("slct");
                PSString.Null = sTID("null");
                PSType.MenuItem = cTID("MnIt");
            };
            CRAuto.loadSymbols();
            CRAuto.main = function() {
                CRAuto();
            };
            CRAuto.main();
            app.refresh();
        } else {
            A();

            function A() {
                if (app) {
                    try {
                        MainCatch3();
                    } catch (e) {

                    }
                }

                function MainCatch3() {
                    var idslct = charIDToTypeID("slct");
                    var desc529 = new ActionDescriptor();
                    var idnull = charIDToTypeID("null");
                    var ref154 = new ActionReference();
                    var idLyr = charIDToTypeID("Lyr ");
                    ref154.putName(idLyr, "Fast Retouch | 2 Method ");
                    desc529.putReference(idnull, ref154);
                    var idMkVs = charIDToTypeID("MkVs");
                    desc529.putBoolean(idMkVs, false);
                    var idLyrI = charIDToTypeID("LyrI");
                    var list28 = new ActionList();
                    list28.putInteger(42);
                    desc529.putList(idLyrI, list28);
                    executeAction(idslct, desc529, DialogModes.NO);
                }
                var name777 = app.activeDocument.activeLayer.name;
                if (name777 === "Fast Retouch | 2 Method ") {
                    if (app) {
                        try {
                            MainCatch4();
                        } catch (e) {

                        }
                    }

                    function MainCatch4() {
                        function Info() {
                            function step1(enabled, withDialog) {
                                if (enabled != undefined && !enabled) {
                                    return;
                                }
                                var dialogMode = withDialog ? DialogModes.ALL : DialogModes.NO;
                                var desc1 = new ActionDescriptor();
                                desc1.putString(PSKey.Message, "你的润色还没有完成。请完成修饰，然后再次按按钮。");
                                executeAction(PSEvent.Stop, desc1, dialogMode);
                            }
                            step1(true, true);
                        }
                        cTID = function(s) {
                            return app.charIDToTypeID(s);
                        };
                        sTID = function(s) {
                            return app.stringIDToTypeID(s);
                        };
                        Info.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() {

                                };
                            }
                            PSEvent.Stop = cTID("Stop");
                            PSKey.Message = cTID("Msge");
                        };
                        Info.loadSymbols();
                        Info.main = function() {
                            Info();
                        };
                        Info.main();
                    }
                } else {
                    function GausFast2copy2() {
                        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, 122);
                            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, "TEMP DB");
                            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("copyToLayer"), undefined, dialogMode);
                        }

                        function step5(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, "Volume");
                            desc1.putObject(PSKey.To, PSClass.Layer, desc2);
                            executeAction(PSEvent.Set, desc1, dialogMode);
                        }

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

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

                        function step8(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, "Texture");
                            desc1.putObject(PSKey.To, PSClass.Layer, desc2);
                            executeAction(PSEvent.Set, desc1, dialogMode);
                        }

                        function step9(enabled, withDialog) {
                            if (enabled != undefined && !enabled) {
                                return;
                            }
                            var dialogMode = withDialog ? DialogModes.ALL : DialogModes.NO;
                            var desc1 = new ActionDescriptor();
                            desc1.putUnitDouble(PSKey.Radius, PSUnit.Pixels, 1);
                            executeAction(sTID("highPass"), desc1, dialogMode);
                        }

                        function step10(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.Channel, PSClass.Channel, PSString.filterMask);
                            desc1.putReference(PSString.Null, ref1);
                            desc1.putBoolean(PSKey.MakeVisible, false);
                            executeAction(PSEvent.Select, desc1, dialogMode);
                        }

                        function step11(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.Channel, PSType.Ordinal, PSEnum.Target);
                            desc1.putReference(PSString.Null, ref1);
                            executeAction(PSEvent.Delete, desc1, dialogMode);
                        }

                        function step12(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.putEnumerated(PSKey.Mode, PSType.BlendMode, PSString.linearLight);
                            desc1.putObject(PSKey.To, PSClass.Layer, desc2);
                            executeAction(PSEvent.Set, desc1, dialogMode);
                        }

                        function step13(enabled, withDialog) {
                            if (enabled != undefined && !enabled) {
                                return;
                            }
                            var dialogMode = withDialog ? DialogModes.ALL : DialogModes.NO;
                            var desc1 = new ActionDescriptor();
                            desc1.putInteger(PSKey.Brightness, 0);
                            desc1.putInteger(PSKey.Contrast, -50);
                            executeAction(sTID("brightnessEvent"), desc1, dialogMode);
                        }

                        function step14(enabled, withDialog) {
                            if (enabled != undefined && !enabled) {
                                return;
                            }
                            var dialogMode = withDialog ? DialogModes.ALL : DialogModes.NO;
                            var desc1 = new ActionDescriptor();
                            var ref1 = new ActionReference();
                            ref1.putName(PSClass.Layer, "Volume");
                            desc1.putReference(PSString.Null, ref1);
                            desc1.putBoolean(PSKey.MakeVisible, false);
                            var list1 = new ActionList();
                            list1.putInteger(124);
                            desc1.putList(PSKey.LayerID, list1);
                            executeAction(PSEvent.Select, desc1, dialogMode);
                        }

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

                        function step16(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, "Surface - Retouch");
                            desc1.putObject(PSKey.To, PSClass.Layer, desc2);
                            executeAction(PSEvent.Set, desc1, dialogMode);
                        }

                        function step17(enabled, withDialog) {
                            if (enabled != undefined && !enabled) {
                                return;
                            }
                            var dialogMode = withDialog ? DialogModes.ALL : DialogModes.NO;
                            var desc1 = new ActionDescriptor();
                            var list1 = new ActionList();
                            var ref1 = new ActionReference();
                            ref1.putEnumerated(PSClass.Layer, PSType.Ordinal, PSEnum.Target);
                            list1.putReference(ref1);
                            desc1.putList(PSString.Null, list1);
                            executeAction(PSEvent.Hide, desc1, dialogMode);
                        }

                        function step18(enabled, withDialog) {
                            if (enabled != undefined && !enabled) {
                                return;
                            }
                            var dialogMode = withDialog ? DialogModes.ALL : DialogModes.NO;
                            var desc1 = new ActionDescriptor();
                            var ref1 = new ActionReference();
                            ref1.putName(PSClass.Layer, "Volume");
                            desc1.putReference(PSString.Null, ref1);
                            desc1.putBoolean(PSKey.MakeVisible, false);
                            var list1 = new ActionList();
                            list1.putInteger(124);
                            desc1.putList(PSKey.LayerID, list1);
                            executeAction(PSEvent.Select, desc1, dialogMode);
                        }

                        function step19(enabled, withDialog) {
                            if (enabled != undefined && !enabled) {
                                return;
                            }
                            var dialogMode = withDialog ? DialogModes.ALL : DialogModes.NO;
                            var desc1 = new ActionDescriptor();
                            desc1.putUnitDouble(PSKey.Radius, PSUnit.Pixels, 1);
                            executeAction(sTID("gaussianBlur"), desc1, dialogMode);
                        }

                        function step20(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.Channel, PSClass.Channel, PSString.filterMask);
                            desc1.putReference(PSString.Null, ref1);
                            desc1.putBoolean(PSKey.MakeVisible, false);
                            executeAction(PSEvent.Select, desc1, dialogMode);
                        }

                        function step21(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.Channel, PSType.Ordinal, PSEnum.Target);
                            desc1.putReference(PSString.Null, ref1);
                            executeAction(PSEvent.Delete, desc1, dialogMode);
                        }

                        function step22(enabled, withDialog) {
                            if (enabled != undefined && !enabled) {
                                return;
                            }
                            var dialogMode = withDialog ? DialogModes.ALL : DialogModes.NO;
                            var desc1 = new ActionDescriptor();
                            var ref1 = new ActionReference();
                            ref1.putName(PSClass.Layer, "Surface - Retouch");
                            desc1.putReference(PSString.Null, ref1);
                            desc1.putBoolean(PSKey.MakeVisible, false);
                            var list1 = new ActionList();
                            list1.putInteger(126);
                            desc1.putList(PSKey.LayerID, list1);
                            executeAction(PSEvent.Select, desc1, dialogMode);
                        }

                        function step23(enabled, withDialog) {
                            if (enabled != undefined && !enabled) {
                                return;
                            }
                            var dialogMode = withDialog ? DialogModes.ALL : DialogModes.NO;
                            var desc1 = new ActionDescriptor();
                            var list1 = new ActionList();
                            var ref1 = new ActionReference();
                            ref1.putEnumerated(PSClass.Layer, PSType.Ordinal, PSEnum.Target);
                            list1.putReference(ref1);
                            desc1.putList(PSString.Null, list1);
                            executeAction(PSEvent.Show, desc1, dialogMode);
                        }

                        function step24(enabled, withDialog) {
                            if (enabled != undefined && !enabled) {
                                return;
                            }
                            var dialogMode = withDialog ? DialogModes.ALL : DialogModes.NO;
                            var desc1 = new ActionDescriptor();
                            desc1.putUnitDouble(PSKey.Radius, PSUnit.Pixels, 60);
                            desc1.putInteger(PSKey.Threshold, 20);
                            executeAction(sTID("surfaceBlur"), desc1, dialogMode);
                        }

                        function step25(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.Channel, PSClass.Channel, PSString.filterMask);
                            desc1.putReference(PSString.Null, ref1);
                            desc1.putBoolean(PSKey.MakeVisible, false);
                            executeAction(PSEvent.Select, desc1, dialogMode);
                        }

                        function step26(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.Channel, PSType.Ordinal, PSEnum.Target);
                            desc1.putReference(PSString.Null, ref1);
                            executeAction(PSEvent.Delete, desc1, dialogMode);
                        }

                        function step27(enabled, withDialog) {
                            if (enabled != undefined && !enabled) {
                                return;
                            }
                            var dialogMode = withDialog ? DialogModes.ALL : DialogModes.NO;
                            var desc1 = new ActionDescriptor();
                            var ref1 = new ActionReference();
                            ref1.putName(PSClass.Layer, "Volume");
                            desc1.putReference(PSString.Null, ref1);
                            desc1.putBoolean(PSKey.MakeVisible, false);
                            var list1 = new ActionList();
                            list1.putInteger(46);
                            desc1.putList(PSKey.LayerID, list1);
                            executeAction(PSEvent.Select, desc1, dialogMode);
                        }

                        function step28(enabled, withDialog) {
                            if (enabled != undefined && !enabled) {
                                return;
                            }
                            var dialogMode = withDialog ? DialogModes.ALL : DialogModes.NO;
                            var desc1 = new ActionDescriptor();
                            var ref1 = new ActionReference();
                            ref1.putName(PSClass.Layer, "Texture");
                            desc1.putReference(PSString.Null, ref1);
                            desc1.putEnumerated(PSString.selectionModifier, PSString.selectionModifierType, PSString.addToSelectionContinuous);
                            desc1.putBoolean(PSKey.MakeVisible, false);
                            var list1 = new ActionList();
                            list1.putInteger(158);
                            list1.putInteger(sTID("skinTone"), 160);
                            list1.putInteger(sTID("contentAware"), 159);
                            desc1.putList(PSKey.LayerID, list1);
                            executeAction(PSEvent.Select, desc1, dialogMode);
                        }

                        function step29(enabled, withDialog) {
                            if (enabled != undefined && !enabled) {
                                return;
                            }
                            var dialogMode = withDialog ? DialogModes.ALL : DialogModes.NO;
                            var desc1 = new ActionDescriptor();
                            var ref1 = new ActionReference();
                            ref1.putClass(PSString.layerGroup);
                            desc1.putReference(PSString.Null, ref1);
                            var ref2 = new ActionReference();
                            ref2.putEnumerated(PSClass.Layer, PSType.Ordinal, PSEnum.Target);
                            desc1.putReference(PSKey.From, ref2);
                            desc1.putInteger(PSString.layerGroupStart, 56);
                            desc1.putInteger(PSString.layerGroupEnd, 57);
                            desc1.putString(PSKey.Name, "Group 1");
                            executeAction(PSEvent.Make, desc1, dialogMode);
                        }

                        function step30(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, "Mask");
                            desc1.putObject(PSKey.To, PSClass.Layer, desc2);
                            executeAction(PSEvent.Set, desc1, dialogMode);
                        }

                        function step31(enabled, withDialog) {
                            if (enabled != undefined && !enabled) {
                                return;
                            }
                            var dialogMode = withDialog ? DialogModes.ALL : DialogModes.NO;
                            var desc1 = new ActionDescriptor();
                            var ref1 = new ActionReference();
                            ref1.putClass(PSString.layerGroup);
                            desc1.putReference(PSString.Null, ref1);
                            var ref2 = new ActionReference();
                            ref2.putEnumerated(PSClass.Layer, PSType.Ordinal, PSEnum.Target);
                            desc1.putReference(PSKey.From, ref2);
                            desc1.putInteger(PSString.layerGroupStart, 58);
                            desc1.putInteger(PSString.layerGroupEnd, 59);
                            desc1.putString(PSKey.Name, "Group 1");
                            executeAction(PSEvent.Make, desc1, dialogMode);
                        }

                        function step32(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, "Fast Retouch | 2 Method ");
                            desc1.putObject(PSKey.To, PSClass.Layer, desc2);
                            executeAction(PSEvent.Set, desc1, dialogMode);
                        }

                        function step33(enabled, withDialog) {
                            if (enabled != undefined && !enabled) {
                                return;
                            }
                            var dialogMode = withDialog ? DialogModes.ALL : DialogModes.NO;
                            var desc1 = new ActionDescriptor();
                            var ref1 = new ActionReference();
                            ref1.putName(PSClass.Layer, "TEMP DB");
                            desc1.putReference(PSString.Null, ref1);
                            desc1.putBoolean(PSKey.MakeVisible, false);
                            var list1 = new ActionList();
                            list1.putInteger(130);
                            desc1.putList(PSKey.LayerID, list1);
                            executeAction(PSEvent.Select, desc1, dialogMode);
                        }

                        function step34(enabled, withDialog) {
                            if (enabled != undefined && !enabled) {
                                return;
                            }
                            var dialogMode = withDialog ? DialogModes.ALL : DialogModes.NO;
                            var desc1 = new ActionDescriptor();
                            desc1.putInteger(PSKey.Fuzziness, 60);
                            desc1.putEnumerated(PSKey.Colors, PSKey.Colors, sTID("skinTone"));
                            desc1.putInteger(sTID("colorModel"), 0);
                            executeAction(sTID("colorRange"), desc1, dialogMode);
                        }

                        function step35(enabled, withDialog) {
                            if (enabled != undefined && !enabled) {
                                return;
                            }
                            var dialogMode = withDialog ? DialogModes.ALL : DialogModes.NO;
                            var desc1 = new ActionDescriptor();
                            var ref1 = new ActionReference();
                            ref1.putName(PSClass.Layer, "Mask");
                            desc1.putReference(PSString.Null, ref1);
                            desc1.putBoolean(PSKey.MakeVisible, false);
                            var list1 = new ActionList();
                            list1.putInteger(56);
                            desc1.putList(PSKey.LayerID, list1);
                            executeAction(PSEvent.Select, desc1, dialogMode);
                        }

                        function step36(enabled, withDialog) {
                            if (enabled != undefined && !enabled) {
                                return;
                            }
                            var dialogMode = withDialog ? DialogModes.ALL : DialogModes.NO;
                            var desc1 = new ActionDescriptor();
                            desc1.putClass(PSKey.New, PSClass.Channel);
                            var ref1 = new ActionReference();
                            ref1.putEnumerated(PSClass.Channel, PSClass.Channel, PSClass.Mask);
                            desc1.putReference(PSKey.At, ref1);
                            desc1.putEnumerated(PSKey.Using, PSType.UserMaskOptions, PSEnum.RevealSelection);
                            executeAction(PSEvent.Make, desc1, dialogMode);
                        }

                        function step37(enabled, withDialog) {
                            if (enabled != undefined && !enabled) {
                                return;
                            }
                            var dialogMode = withDialog ? DialogModes.ALL : DialogModes.NO;
                            var desc1 = new ActionDescriptor();
                            desc1.putUnitDouble(PSKey.Radius, PSUnit.Pixels, 5);
                            executeAction(sTID("gaussianBlur"), desc1, dialogMode);
                        }

                        function step38(enabled, withDialog) {
                            if (enabled != undefined && !enabled) {
                                return;
                            }
                            var dialogMode = withDialog ? DialogModes.ALL : DialogModes.NO;
                            var desc1 = new ActionDescriptor();
                            var ref1 = new ActionReference();
                            ref1.putName(PSClass.Layer, "TEMP DB");
                            desc1.putReference(PSString.Null, ref1);
                            desc1.putBoolean(PSKey.MakeVisible, false);
                            var list1 = new ActionList();
                            list1.putInteger(130);
                            desc1.putList(PSKey.LayerID, list1);
                            executeAction(PSEvent.Select, desc1, dialogMode);
                        }

                        function step39(enabled, withDialog) {
                            if (enabled != undefined && !enabled) {
                                return;
                            }
                            var dialogMode = withDialog ? DialogModes.ALL : DialogModes.NO;
                            executeAction(PSEvent.Desaturate, undefined, dialogMode);
                        }

                        function step40(enabled, withDialog) {
                            if (enabled != undefined && !enabled) {
                                return;
                            }
                            var dialogMode = withDialog ? DialogModes.ALL : DialogModes.NO;
                            var desc1 = new ActionDescriptor();
                            var ref1 = new ActionReference();
                            ref1.putName(PSClass.Layer, "Texture");
                            desc1.putReference(PSString.Null, ref1);
                            desc1.putBoolean(PSKey.MakeVisible, false);
                            var list1 = new ActionList();
                            list1.putInteger(36);
                            desc1.putList(PSKey.LayerID, list1);
                            executeAction(PSEvent.Select, desc1, dialogMode);
                        }

                        function step41(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);
                            executeAction(PSEvent.Make, desc1, dialogMode);
                        }

                        function step42(enabled, withDialog) {
                            if (enabled != undefined && !enabled) {
                                return;
                            }
                            var dialogMode = withDialog ? DialogModes.ALL : DialogModes.NO;
                            var desc1 = new ActionDescriptor();
                            var desc2 = new ActionDescriptor();
                            var ref1 = new ActionReference();
                            ref1.putEnumerated(PSClass.Channel, PSClass.Channel, PSEnum.RGB);
                            ref1.putName(PSClass.Layer, "TEMP DB");
                            desc2.putReference(PSKey.To, ref1);
                            desc1.putObject(PSKey.With, PSClass.Calculation, desc2);
                            executeAction(sTID("applyImageEvent"), desc1, dialogMode);
                        }

                        function step43(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, "Dodge and Burn");
                            desc1.putObject(PSKey.To, PSClass.Layer, desc2);
                            executeAction(PSEvent.Set, desc1, dialogMode);
                        }

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

                        function step45(enabled, withDialog) {
                            if (enabled != undefined && !enabled) {
                                return;
                            }
                            var dialogMode = withDialog ? DialogModes.ALL : DialogModes.NO;
                            var desc1 = new ActionDescriptor();
                            desc1.putUnitDouble(PSKey.Radius, PSUnit.Pixels, 100);
                            executeAction(sTID("highPass"), desc1, dialogMode);
                        }

                        function step46(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.putEnumerated(PSKey.Mode, PSType.BlendMode, PSEnum.Overlay);
                            desc1.putObject(PSKey.To, PSClass.Layer, desc2);
                            executeAction(PSEvent.Set, desc1, dialogMode);
                        }

                        function step47(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.Channel, PSClass.Channel, PSString.filterMask);
                            desc1.putReference(PSString.Null, ref1);
                            desc1.putBoolean(PSKey.MakeVisible, false);
                            executeAction(PSEvent.Select, desc1, dialogMode);
                        }

                        function step48(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.Channel, PSType.Ordinal, PSEnum.Target);
                            desc1.putReference(PSString.Null, ref1);
                            executeAction(PSEvent.Delete, desc1, dialogMode);
                        }

                        function step49(enabled, withDialog) {
                            if (enabled != undefined && !enabled) {
                                return;
                            }
                            var dialogMode = withDialog ? DialogModes.ALL : DialogModes.NO;
                            var desc1 = new ActionDescriptor();
                            desc1.putUnitDouble(PSKey.Radius, PSUnit.Pixels, 25);
                            executeAction(sTID("gaussianBlur"), desc1, dialogMode);
                            var idsetd = charIDToTypeID("setd");
                            var desc6629 = new ActionDescriptor();
                            var idnull = charIDToTypeID("null");
                            var ref2427 = new ActionReference();
                            var idLyr = charIDToTypeID("Lyr ");
                            var idOrdn = charIDToTypeID("Ordn");
                            var idTrgt = charIDToTypeID("Trgt");
                            ref2427.putEnumerated(idLyr, idOrdn, idTrgt);
                            desc6629.putReference(idnull, ref2427);
                            var idT = charIDToTypeID("T   ");
                            var desc6630 = new ActionDescriptor();
                            var idOpct = charIDToTypeID("Opct");
                            var idPrc = charIDToTypeID("#Prc");
                            desc6630.putUnitDouble(idOpct, idPrc, 30);
                            var idLyr = charIDToTypeID("Lyr ");
                            desc6629.putObject(idT, idLyr, desc6630);
                            executeAction(idsetd, desc6629, DialogModes.NO);
                        }

                        function step50(enabled, withDialog) {
                            if (enabled != undefined && !enabled) {
                                return;
                            }
                            var dialogMode = withDialog ? DialogModes.ALL : DialogModes.NO;
                            var desc1 = new ActionDescriptor();
                            var ref1 = new ActionReference();
                            ref1.putName(PSClass.Layer, "TEMP DB");
                            desc1.putReference(PSString.Null, ref1);
                            desc1.putBoolean(PSKey.MakeVisible, false);
                            var list1 = new ActionList();
                            list1.putInteger(142);
                            desc1.putList(PSKey.LayerID, list1);
                            executeAction(PSEvent.Select, desc1, dialogMode);
                        }

                        function step51(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 list1 = new ActionList();
                            list1.putInteger(142);
                            desc1.putList(PSKey.LayerID, list1);
                            executeAction(PSEvent.Delete, desc1, dialogMode);
                        }
                        step1();
                        step2();
                        step3();
                        step4();
                        step5();
                        step6();
                        step7();
                        step8();
                        step9();
                        step10();
                        step11();
                        step12();
                        step13();
                        step14();
                        step15();
                        step16();
                        step17();
                        step18();
                        step19();
                        step20();
                        step21();
                        step22();
                        step23();
                        step24();
                        step25();
                        step26();
                        step27();
                        step28();
                        step29();
                        step30();
                        step31();
                        step32();
                        step33();
                        step34();
                        step35();
                        step36();
                        step37();
                        step38();
                        step39();
                        step40();
                        step41();
                        step42();
                        step43();
                        step44();
                        step45();
                        step46();
                        step47();
                        step48();
                        step49();
                        step50();
                        step51();
                    }
                    cTID = function(s) {
                        return app.charIDToTypeID(s);
                    };
                    sTID = function(s) {
                        return app.stringIDToTypeID(s);
                    };
                    GausFast2copy2.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.Calculation = cTID("Clcl");
                        PSClass.Channel = cTID("Chnl");
                        PSClass.Layer = cTID("Lyr ");
                        PSClass.Mask = cTID("Msk ");
                        PSEnum.Overlay = cTID("Ovrl");
                        PSEnum.RGB = cTID("RGB ");
                        PSEnum.RevealSelection = cTID("RvlS");
                        PSEnum.Target = cTID("Trgt");
                        PSEvent.Delete = cTID("Dlt ");
                        PSEvent.Desaturate = cTID("Dstt");
                        PSEvent.Hide = cTID("Hd  ");
                        PSEvent.Make = cTID("Mk  ");
                        PSEvent.Select = cTID("slct");
                        PSEvent.Set = cTID("setd");
                        PSEvent.Show = cTID("Shw ");
                        PSKey.At = cTID("At  ");
                        PSKey.Brightness = cTID("Brgh");
                        PSKey.Colors = cTID("Clrs");
                        PSKey.Contrast = cTID("Cntr");
                        PSKey.Duplicate = cTID("Dplc");
                        PSKey.From = cTID("From");
                        PSKey.Fuzziness = cTID("Fzns");
                        PSKey.LayerID = cTID("LyrI");
                        PSKey.MakeVisible = cTID("MkVs");
                        PSKey.Mode = cTID("Md  ");
                        PSKey.Name = cTID("Nm  ");
                        PSKey.New = cTID("Nw  ");
                        PSKey.Radius = cTID("Rds ");
                        PSKey.Threshold = cTID("Thsh");
                        PSKey.To = cTID("T   ");
                        PSKey.Using = cTID("Usng");
                        PSKey.With = cTID("With");
                        PSString.Null = sTID("null");
                        PSString.addToSelectionContinuous = sTID("addToSelectionContinuous");
                        PSString.filterMask = sTID("filterMask");
                        PSString.layerGroup = sTID("layerSection");
                        PSString.layerGroupEnd = sTID("layerSectionEnd");
                        PSString.layerGroupStart = sTID("layerSectionStart");
                        PSString.linearLight = sTID("linearLight");
                        PSString.selectionModifier = sTID("selectionModifier");
                        PSString.selectionModifierType = sTID("selectionModifierType");
                        PSType.BlendMode = cTID("BlnM");
                        PSType.Ordinal = cTID("Ordn");
                        PSType.UserMaskOptions = cTID("UsrM");
                        PSUnit.Pixels = cTID("#Pxl");
                    };
                    GausFast2copy2.loadSymbols();
                    GausFast2copy2.main = function() {
                        GausFast2copy2();
                    };
                    GausFast2copy2.main();
                }
            }
            var idslct = charIDToTypeID("slct");
            var desc890 = new ActionDescriptor();
            var idnull = charIDToTypeID("null");
            var ref425 = new ActionReference();
            var idLyr = charIDToTypeID("Lyr ");
            ref425.putName(idLyr, "Mask");
            desc890.putReference(idnull, ref425);
            var idMkVs = charIDToTypeID("MkVs");
            desc890.putBoolean(idMkVs, false);
            var idLyrI = charIDToTypeID("LyrI");
            var list127 = new ActionList();
            list127.putInteger(76);
            desc890.putList(idLyrI, list127);
            executeAction(idslct, desc890, DialogModes.NO);
            var idsetd = charIDToTypeID("setd");
            var desc2 = new ActionDescriptor();
            var idnull = charIDToTypeID("null");
            var ref1 = new ActionReference();
            var idPrpr = charIDToTypeID("Prpr");
            var idTxtS = stringIDToTypeID("layerSectionExpanded");
            ref1.putProperty(idPrpr, idTxtS);
            var idLyr = charIDToTypeID("Lyr ");
            var idOrdn = charIDToTypeID("Ordn");
            var idTrgt = charIDToTypeID("Trgt");
            ref1.putEnumerated(idLyr, idOrdn, idTrgt);
            desc2.putReference(idnull, ref1);
            var idT = charIDToTypeID("T   ");
            desc2.putBoolean(charIDToTypeID("T   "), false);
            desc2.putBoolean(stringIDToTypeID("recursive"), true);
            executeAction(idsetd, desc2, 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, 0, 0, 100);
sliderF.preferredSize.width = s1L;
sliderValueF = sliderGroup.add("statictext", undefined, " 0   ");
sliderF.onChanging = function() {
    sliderValueF.text = Math.round(this.value);
};
sliderF.onChange = function() {
    foo2 = Math.round(this.value);
    foo = foo2 / 5;
    var idsetd = charIDToTypeID("setd");
    var desc4 = new ActionDescriptor();
    var idnull = charIDToTypeID("null");
    var ref3 = new ActionReference();
    var idfilterFX = stringIDToTypeID("filterFX");
    ref3.putIndex(idfilterFX, 1);
    var idLyr = charIDToTypeID("Lyr ");
    ref3.putName(idLyr, "Texture");
    desc4.putReference(idnull, ref3);
    var idfilterFX = stringIDToTypeID("filterFX");
    var desc5 = new ActionDescriptor();
    var idFltr = charIDToTypeID("Fltr");
    var desc6 = new ActionDescriptor();
    var idRds = charIDToTypeID("Rds ");
    var idPxl = charIDToTypeID("#Pxl");
    desc6.putUnitDouble(idRds, idPxl, foo);
    var idHghP = charIDToTypeID("HghP");
    desc5.putObject(idFltr, idHghP, desc6);
    var idfilterFX = stringIDToTypeID("filterFX");
    desc4.putObject(idfilterFX, idfilterFX, desc5);
    executeAction(idsetd, desc4, DialogModes.NO);
    var idsetd = charIDToTypeID("setd");
    var desc8 = new ActionDescriptor();
    var idnull = charIDToTypeID("null");
    var ref5 = new ActionReference();
    var idfilterFX = stringIDToTypeID("filterFX");
    ref5.putIndex(idfilterFX, 1);
    var idLyr = charIDToTypeID("Lyr ");
    ref5.putName(idLyr, "Volume");
    desc8.putReference(idnull, ref5);
    var idfilterFX = stringIDToTypeID("filterFX");
    var desc9 = new ActionDescriptor();
    var idFltr = charIDToTypeID("Fltr");
    var desc10 = new ActionDescriptor();
    var idRds = charIDToTypeID("Rds ");
    var idPxl = charIDToTypeID("#Pxl");
    desc10.putUnitDouble(idRds, idPxl, foo);
    var idGsnB = charIDToTypeID("GsnB");
    desc9.putObject(idFltr, idGsnB, desc10);
    var idfilterFX = stringIDToTypeID("filterFX");
    desc8.putObject(idfilterFX, idfilterFX, desc9);
    executeAction(idsetd, desc8, DialogModes.NO);
    app.refresh();
};
sliderGroup4477 = leftGr.add("group");
sliderGroup4477.alignment = "left";
slTxt22 = sliderGroup4477.add("staticText", undefined, "纹理控制：");
sliderGroup688 = leftGr.add("group");
sliderFF = sliderGroup688.add("slider", undefined, 60, 0, 120);
sliderFF.preferredSize.width = s1L;
sliderValueFF = sliderGroup688.add("statictext", undefined, " 60  ");
sliderFF.onChanging = function() {
    sliderValueFF.text = Math.round(this.value);
};
sliderFF.onChange = function() {
    foo = Math.round(this.value);
    foo3 = foo - 110;
    var idsetd = charIDToTypeID("setd");
    var desc6 = new ActionDescriptor();
    var idnull = charIDToTypeID("null");
    var ref2 = new ActionReference();
    var idfilterFX = stringIDToTypeID("filterFX");
    ref2.putIndex(idfilterFX, 2);
    var idLyr = charIDToTypeID("Lyr ");
    ref2.putName(idLyr, "Texture");
    desc6.putReference(idnull, ref2);
    var idfilterFX = stringIDToTypeID("filterFX");
    var desc7 = new ActionDescriptor();
    var idFltr = charIDToTypeID("Fltr");
    var desc8 = new ActionDescriptor();
    var idBrgh = charIDToTypeID("Brgh");
    desc8.putInteger(idBrgh, 0);
    var idCntr = charIDToTypeID("Cntr");
    desc8.putInteger(idCntr, foo3);
    var idBrgC = charIDToTypeID("BrgC");
    desc7.putObject(idFltr, idBrgC, desc8);
    var idfilterFX = stringIDToTypeID("filterFX");
    desc6.putObject(idfilterFX, idfilterFX, desc7);
    executeAction(idsetd, desc6, DialogModes.NO);
    app.refresh();
};
baton289 = leftGr.add("group");
baton289.alignment = "left";
Generate5555 = baton289.add("button", undefined, "表面模糊");
Generate5555.preferredSize.width = b1L;
Generate5555.onClick = function() {
    function EditSurface() {
        function step1(enabled, withDialog) {
            if (enabled != undefined && !enabled) {
                return;
            }
        }

        function step2(enabled, withDialog) {
            if (enabled != undefined && !enabled) {
                return;
            }
            var dialogMode = withDialog ? DialogModes.ALL : DialogModes.NO;
            var desc1 = new ActionDescriptor();
            var ref1 = new ActionReference();
            ref1.putIndex(PSString.filterFX, 1);
            ref1.putName(PSClass.Layer, "Surface - Retouch");
            desc1.putReference(PSString.Null, ref1);
            var desc2 = new ActionDescriptor();
            var desc3 = new ActionDescriptor();
            desc3.putUnitDouble(PSKey.Radius, PSUnit.Pixels, 60);
            desc3.putInteger(PSKey.Threshold, 30);
            desc2.putObject(PSEvent.Filter, PSString.bilateral, desc3);
            desc1.putObject(PSString.filterFX, PSString.filterFX, desc2);
            executeAction(PSEvent.Set, desc1, dialogMode);
        }
        step1();
        step2(true, true);
    }
    cTID = function(s) {
        return app.charIDToTypeID(s);
    };
    sTID = function(s) {
        return app.stringIDToTypeID(s);
    };
    EditSurface.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.Layer = cTID("Lyr ");
        PSEnum.Target = cTID("Trgt");
        PSEvent.Filter = cTID("Fltr");
        PSEvent.Select = cTID("slct");
        PSEvent.Set = cTID("setd");
        PSKey.LayerID = cTID("LyrI");
        PSKey.MakeVisible = cTID("MkVs");
        PSKey.Radius = cTID("Rds ");
        PSKey.Threshold = cTID("Thsh");
        PSString.Null = sTID("null");
        PSString.bilateral = sTID("surfaceBlur");
        PSString.filterFX = sTID("filterFX");
        PSType.Ordinal = cTID("Ordn");
        PSUnit.Pixels = cTID("#Pxl");
    };
    EditSurface.loadSymbols();
    EditSurface.main = function() {
        EditSurface();
    };
    EditSurface.main();
};
baton25991 = leftGr.add("group");
baton25991.alignment = "left";
Generate5555556 = baton25991.add("button", undefined, "显示蒙版");
Generate5555556.preferredSize.width = b1L;
Generate5555556.onClick = function() {
    if (phaseOne != 1) {
        Generate5555556.text = "Hide Mask";
        phaseOne = 1;
        if (app) {
            try {
                MainCatch3();
            } catch (e) {

            }
        }

        function MainCatch3() {
            var idslct = charIDToTypeID("slct");
            var desc6668 = new ActionDescriptor();
            var idnull = charIDToTypeID("null");
            var ref2434 = new ActionReference();
            var idLyr = charIDToTypeID("Lyr ");
            ref2434.putName(idLyr, "Mask");
            desc6668.putReference(idnull, ref2434);
            var idMkVs = charIDToTypeID("MkVs");
            desc6668.putBoolean(idMkVs, false);
            executeAction(idslct, desc6668, DialogModes.NO);
            var idslct = charIDToTypeID("slct");
            var desc6669 = new ActionDescriptor();
            var idnull = charIDToTypeID("null");
            var ref2435 = new ActionReference();
            var idPbTl = charIDToTypeID("PbTl");
            ref2435.putClass(idPbTl);
            desc6669.putReference(idnull, ref2435);
            executeAction(idslct, desc6669, DialogModes.NO);
            var idsetd = charIDToTypeID("setd");
            var desc6682 = new ActionDescriptor();
            var idnull = charIDToTypeID("null");
            var ref2437 = new ActionReference();
            var idClr = charIDToTypeID("Clr ");
            var idFrgC = charIDToTypeID("FrgC");
            ref2437.putProperty(idClr, idFrgC);
            desc6682.putReference(idnull, ref2437);
            var idT = charIDToTypeID("T   ");
            var desc6683 = new ActionDescriptor();
            var idH = charIDToTypeID("H   ");
            var idAng = charIDToTypeID("#Ang");
            desc6683.putUnitDouble(idH, idAng, 0);
            var idStrt = charIDToTypeID("Strt");
            desc6683.putDouble(idStrt, 0);
            var idBrgh = charIDToTypeID("Brgh");
            desc6683.putDouble(idBrgh, 0);
            var idHSBC = charIDToTypeID("HSBC");
            desc6682.putObject(idT, idHSBC, desc6683);
            var idSrce = charIDToTypeID("Srce");
            desc6682.putString(idSrce, "photoshopPicker");
            executeAction(idsetd, desc6682, DialogModes.NO);
            var idsetd = charIDToTypeID("setd");
            var desc9 = new ActionDescriptor();
            var idnull = charIDToTypeID("null");
            var ref3 = new ActionReference();
            var idClr = charIDToTypeID("Clr ");
            var idFrgC = charIDToTypeID("FrgC");
            ref3.putProperty(idClr, idFrgC);
            desc9.putReference(idnull, ref3);
            var idT = charIDToTypeID("T   ");
            var desc10 = new ActionDescriptor();
            var idH = charIDToTypeID("H   ");
            var idAng = charIDToTypeID("#Ang");
            desc10.putUnitDouble(idH, idAng, 0);
            var idStrt = charIDToTypeID("Strt");
            desc10.putDouble(idStrt, 0);
            var idBrgh = charIDToTypeID("Brgh");
            desc10.putDouble(idBrgh, 0);
            var idHSBC = charIDToTypeID("HSBC");
            desc9.putObject(idT, idHSBC, desc10);
            var idSrce = charIDToTypeID("Srce");
            desc9.putString(idSrce, "photoshopPicker");
            executeAction(idsetd, desc9, DialogModes.NO);
            var idsetd = charIDToTypeID("setd");
            var desc13 = new ActionDescriptor();
            var idnull = charIDToTypeID("null");
            var ref4 = new ActionReference();
            var idClr = charIDToTypeID("Clr ");
            var idBckC = charIDToTypeID("BckC");
            ref4.putProperty(idClr, idBckC);
            desc13.putReference(idnull, ref4);
            var idT = charIDToTypeID("T   ");
            var desc14 = new ActionDescriptor();
            var idH = charIDToTypeID("H   ");
            var idAng = charIDToTypeID("#Ang");
            desc14.putUnitDouble(idH, idAng, 0);
            var idStrt = charIDToTypeID("Strt");
            desc14.putDouble(idStrt, 0);
            var idBrgh = charIDToTypeID("Brgh");
            desc14.putDouble(idBrgh, 100);
            var idHSBC = charIDToTypeID("HSBC");
            desc13.putObject(idT, idHSBC, desc14);
            var idSrce = charIDToTypeID("Srce");
            desc13.putString(idSrce, "photoshopPicker");
            executeAction(idsetd, desc13, DialogModes.NO);
            var idslct = charIDToTypeID("slct");
            var desc2 = new ActionDescriptor();
            var idnull = charIDToTypeID("null");
            var ref1 = new ActionReference();
            var idChnl = charIDToTypeID("Chnl");
            var idChnl = charIDToTypeID("Chnl");
            var idMsk = charIDToTypeID("Msk ");
            ref1.putEnumerated(idChnl, idChnl, idMsk);
            desc2.putReference(idnull, ref1);
            var idMkVs = charIDToTypeID("MkVs");
            desc2.putBoolean(idMkVs, true);
            executeAction(idslct, desc2, DialogModes.NO);
        }
        app.refresh();
    } else {
        Generate5555556.text = "Show Mask";
        phaseOne = 2;
        var idslct = charIDToTypeID("slct");
        var desc1257 = new ActionDescriptor();
        var idnull = charIDToTypeID("null");
        var ref614 = new ActionReference();
        var idChnl = charIDToTypeID("Chnl");
        var idChnl = charIDToTypeID("Chnl");
        var idRGB = charIDToTypeID("RGB ");
        ref614.putEnumerated(idChnl, idChnl, idRGB);
        desc1257.putReference(idnull, ref614);
        var idMkVs = charIDToTypeID("MkVs");
        desc1257.putBoolean(idMkVs, false);
        executeAction(idslct, desc1257, DialogModes.NO);
        var idslct = charIDToTypeID("slct");
        var desc1258 = new ActionDescriptor();
        var idnull = charIDToTypeID("null");
        var ref615 = new ActionReference();
        var idChnl = charIDToTypeID("Chnl");
        var idChnl = charIDToTypeID("Chnl");
        var idMsk = charIDToTypeID("Msk ");
        ref615.putEnumerated(idChnl, idChnl, idMsk);
        desc1258.putReference(idnull, ref615);
        var idMkVs = charIDToTypeID("MkVs");
        desc1258.putBoolean(idMkVs, false);
        executeAction(idslct, desc1258, DialogModes.NO);
        app.refresh();
    }
};
baton2599 = leftGr.add("group");
baton2599.alignment = "left";
Generate555555 = baton2599.add("button", undefined, "编辑蒙版");
Generate555555.preferredSize.width = b1L;
Generate555555.onClick = function() {
    if (ScriptUI.environment.keyboardState.shiftKey) {
        if (app) {
            try {
                MainCatch3();
            } catch (e) {

            }
        }

        function MainCatch3() {
            var idslct = charIDToTypeID("slct");
            var desc6668 = new ActionDescriptor();
            var idnull = charIDToTypeID("null");
            var ref2434 = new ActionReference();
            var idLyr = charIDToTypeID("Lyr ");
            ref2434.putName(idLyr, "Mask");
            desc6668.putReference(idnull, ref2434);
            var idMkVs = charIDToTypeID("MkVs");
            desc6668.putBoolean(idMkVs, false);
            executeAction(idslct, desc6668, DialogModes.NO);
            var idslct = charIDToTypeID("slct");
            var desc6669 = new ActionDescriptor();
            var idnull = charIDToTypeID("null");
            var ref2435 = new ActionReference();
            var idPbTl = charIDToTypeID("PbTl");
            ref2435.putClass(idPbTl);
            desc6669.putReference(idnull, ref2435);
            executeAction(idslct, desc6669, DialogModes.NO);
            var idsetd = charIDToTypeID("setd");
            var desc6682 = new ActionDescriptor();
            var idnull = charIDToTypeID("null");
            var ref2437 = new ActionReference();
            var idClr = charIDToTypeID("Clr ");
            var idFrgC = charIDToTypeID("FrgC");
            ref2437.putProperty(idClr, idFrgC);
            desc6682.putReference(idnull, ref2437);
            var idT = charIDToTypeID("T   ");
            var desc6683 = new ActionDescriptor();
            var idH = charIDToTypeID("H   ");
            var idAng = charIDToTypeID("#Ang");
            desc6683.putUnitDouble(idH, idAng, 0);
            var idStrt = charIDToTypeID("Strt");
            desc6683.putDouble(idStrt, 0);
            var idBrgh = charIDToTypeID("Brgh");
            desc6683.putDouble(idBrgh, 0);
            var idHSBC = charIDToTypeID("HSBC");
            desc6682.putObject(idT, idHSBC, desc6683);
            var idSrce = charIDToTypeID("Srce");
            desc6682.putString(idSrce, "photoshopPicker");
            executeAction(idsetd, desc6682, DialogModes.NO);
            var idsetd = charIDToTypeID("setd");
            var desc9 = new ActionDescriptor();
            var idnull = charIDToTypeID("null");
            var ref3 = new ActionReference();
            var idClr = charIDToTypeID("Clr ");
            var idFrgC = charIDToTypeID("FrgC");
            ref3.putProperty(idClr, idFrgC);
            desc9.putReference(idnull, ref3);
            var idT = charIDToTypeID("T   ");
            var desc10 = new ActionDescriptor();
            var idH = charIDToTypeID("H   ");
            var idAng = charIDToTypeID("#Ang");
            desc10.putUnitDouble(idH, idAng, 0);
            var idStrt = charIDToTypeID("Strt");
            desc10.putDouble(idStrt, 0);
            var idBrgh = charIDToTypeID("Brgh");
            desc10.putDouble(idBrgh, 0);
            var idHSBC = charIDToTypeID("HSBC");
            desc9.putObject(idT, idHSBC, desc10);
            var idSrce = charIDToTypeID("Srce");
            desc9.putString(idSrce, "photoshopPicker");
            executeAction(idsetd, desc9, DialogModes.NO);
            var idsetd = charIDToTypeID("setd");
            var desc13 = new ActionDescriptor();
            var idnull = charIDToTypeID("null");
            var ref4 = new ActionReference();
            var idClr = charIDToTypeID("Clr ");
            var idBckC = charIDToTypeID("BckC");
            ref4.putProperty(idClr, idBckC);
            desc13.putReference(idnull, ref4);
            var idT = charIDToTypeID("T   ");
            var desc14 = new ActionDescriptor();
            var idH = charIDToTypeID("H   ");
            var idAng = charIDToTypeID("#Ang");
            desc14.putUnitDouble(idH, idAng, 0);
            var idStrt = charIDToTypeID("Strt");
            desc14.putDouble(idStrt, 0);
            var idBrgh = charIDToTypeID("Brgh");
            desc14.putDouble(idBrgh, 100);
            var idHSBC = charIDToTypeID("HSBC");
            desc13.putObject(idT, idHSBC, desc14);
            var idSrce = charIDToTypeID("Srce");
            desc13.putString(idSrce, "photoshopPicker");
            executeAction(idsetd, desc13, DialogModes.NO);
            var idslct = charIDToTypeID("slct");
            var desc2 = new ActionDescriptor();
            var idnull = charIDToTypeID("null");
            var ref1 = new ActionReference();
            var idChnl = charIDToTypeID("Chnl");
            var idChnl = charIDToTypeID("Chnl");
            var idMsk = charIDToTypeID("Msk ");
            ref1.putEnumerated(idChnl, idChnl, idMsk);
            desc2.putReference(idnull, ref1);
            var idMkVs = charIDToTypeID("MkVs");
            desc2.putBoolean(idMkVs, true);
            executeAction(idslct, desc2, DialogModes.NO);
        }
        close = true;
        win.close();
    } else {
        if (app) {
            try {
                MainCatch3();
            } catch (e) {

            }
        }

        function MainCatch3() {
            var idslct = charIDToTypeID("slct");
            var desc6668 = new ActionDescriptor();
            var idnull = charIDToTypeID("null");
            var ref2434 = new ActionReference();
            var idLyr = charIDToTypeID("Lyr ");
            ref2434.putName(idLyr, "Mask");
            desc6668.putReference(idnull, ref2434);
            var idMkVs = charIDToTypeID("MkVs");
            desc6668.putBoolean(idMkVs, false);
            executeAction(idslct, desc6668, DialogModes.NO);
            var idslct = charIDToTypeID("slct");
            var desc6669 = new ActionDescriptor();
            var idnull = charIDToTypeID("null");
            var ref2435 = new ActionReference();
            var idPbTl = charIDToTypeID("PbTl");
            ref2435.putClass(idPbTl);
            desc6669.putReference(idnull, ref2435);
            executeAction(idslct, desc6669, DialogModes.NO);
            var idsetd = charIDToTypeID("setd");
            var desc6682 = new ActionDescriptor();
            var idnull = charIDToTypeID("null");
            var ref2437 = new ActionReference();
            var idClr = charIDToTypeID("Clr ");
            var idFrgC = charIDToTypeID("FrgC");
            ref2437.putProperty(idClr, idFrgC);
            desc6682.putReference(idnull, ref2437);
            var idT = charIDToTypeID("T   ");
            var desc6683 = new ActionDescriptor();
            var idH = charIDToTypeID("H   ");
            var idAng = charIDToTypeID("#Ang");
            desc6683.putUnitDouble(idH, idAng, 0);
            var idStrt = charIDToTypeID("Strt");
            desc6683.putDouble(idStrt, 0);
            var idBrgh = charIDToTypeID("Brgh");
            desc6683.putDouble(idBrgh, 0);
            var idHSBC = charIDToTypeID("HSBC");
            desc6682.putObject(idT, idHSBC, desc6683);
            var idSrce = charIDToTypeID("Srce");
            desc6682.putString(idSrce, "photoshopPicker");
            executeAction(idsetd, desc6682, DialogModes.NO);
            var idsetd = charIDToTypeID("setd");
            var desc9 = new ActionDescriptor();
            var idnull = charIDToTypeID("null");
            var ref3 = new ActionReference();
            var idClr = charIDToTypeID("Clr ");
            var idFrgC = charIDToTypeID("FrgC");
            ref3.putProperty(idClr, idFrgC);
            desc9.putReference(idnull, ref3);
            var idT = charIDToTypeID("T   ");
            var desc10 = new ActionDescriptor();
            var idH = charIDToTypeID("H   ");
            var idAng = charIDToTypeID("#Ang");
            desc10.putUnitDouble(idH, idAng, 0);
            var idStrt = charIDToTypeID("Strt");
            desc10.putDouble(idStrt, 0);
            var idBrgh = charIDToTypeID("Brgh");
            desc10.putDouble(idBrgh, 0);
            var idHSBC = charIDToTypeID("HSBC");
            desc9.putObject(idT, idHSBC, desc10);
            var idSrce = charIDToTypeID("Srce");
            desc9.putString(idSrce, "photoshopPicker");
            executeAction(idsetd, desc9, DialogModes.NO);
            var idsetd = charIDToTypeID("setd");
            var desc13 = new ActionDescriptor();
            var idnull = charIDToTypeID("null");
            var ref4 = new ActionReference();
            var idClr = charIDToTypeID("Clr ");
            var idBckC = charIDToTypeID("BckC");
            ref4.putProperty(idClr, idBckC);
            desc13.putReference(idnull, ref4);
            var idT = charIDToTypeID("T   ");
            var desc14 = new ActionDescriptor();
            var idH = charIDToTypeID("H   ");
            var idAng = charIDToTypeID("#Ang");
            desc14.putUnitDouble(idH, idAng, 0);
            var idStrt = charIDToTypeID("Strt");
            desc14.putDouble(idStrt, 0);
            var idBrgh = charIDToTypeID("Brgh");
            desc14.putDouble(idBrgh, 100);
            var idHSBC = charIDToTypeID("HSBC");
            desc13.putObject(idT, idHSBC, desc14);
            var idSrce = charIDToTypeID("Srce");
            desc13.putString(idSrce, "photoshopPicker");
            executeAction(idsetd, desc13, DialogModes.NO);
        }
        close = true;
        win.close();
    }
};
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 idShw = charIDToTypeID("Shw ");
        var desc2242 = new ActionDescriptor();
        var idnull = charIDToTypeID("null");
        var list679 = new ActionList();
        var ref1149 = new ActionReference();
        var idLyr = charIDToTypeID("Lyr ");
        ref1149.putName(idLyr, "Dodge and Burn");
        list679.putReference(ref1149);
        desc2242.putList(idnull, list679);
        executeAction(idShw, desc2242, DialogModes.NO);
        app.refresh();
    } else {
        var idHd = charIDToTypeID("Hd  ");
        var desc2241 = new ActionDescriptor();
        var idnull = charIDToTypeID("null");
        var list678 = new ActionList();
        var ref1148 = new ActionReference();
        var idLyr = charIDToTypeID("Lyr ");
        ref1148.putName(idLyr, "Dodge and Burn");
        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";
slTxt3334 = sliderGroup.add("staticText", undefined, "不透明度：");
sliderDC = sliderGroup.add("slider", undefined, 30, 0, 100);
sliderDC.preferredSize.width = s2L;
sliderValueDC = sliderGroup.add("statictext", undefined, " 30 ");
sliderGroup = leftGr.add("group");
sliderGroup.orientation = "row";
sliderGroup.alignChildren = ["fill", "fill"];
sliderGroup.alignment = "left";
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);
    foo2 = foo / 2;
    var idsetd = charIDToTypeID("setd");
    var desc198 = new ActionDescriptor();
    var idnull = charIDToTypeID("null");
    var ref129 = new ActionReference();
    var idfilterFX = stringIDToTypeID("filterFX");
    ref129.putIndex(idfilterFX, 2);
    var idLyr = charIDToTypeID("Lyr ");
    ref129.putName(idLyr, "Dodge and Burn");
    desc198.putReference(idnull, ref129);
    var idfilterFX = stringIDToTypeID("filterFX");
    var desc199 = new ActionDescriptor();
    var idFltr = charIDToTypeID("Fltr");
    var desc200 = new ActionDescriptor();
    var idRds = charIDToTypeID("Rds ");
    var idPxl = charIDToTypeID("#Pxl");
    desc200.putUnitDouble(idRds, idPxl, foo2);
    var idGsnB = charIDToTypeID("GsnB");
    desc199.putObject(idFltr, idGsnB, desc200);
    var idfilterFX = stringIDToTypeID("filterFX");
    desc198.putObject(idfilterFX, idfilterFX, desc199);
    executeAction(idsetd, desc198, DialogModes.NO);
    app.refresh();
};
sliderGroup = leftGr.add("group");
sliderGroup.orientation = "row";
sliderGroup.alignChildren = ["fill", "fill"];
sliderGroup.alignment = "left";
slTxt334 = sliderGroup.add("staticText", undefined, "对比度： ");
sliderD = sliderGroup.add("slider", undefined, 50, 0, 100);
sliderD.preferredSize.width = s2L;
sliderValueD = sliderGroup.add("statictext", undefined, " 50  ");
sliderD.onChanging = function() {
    sliderValueD.text = Math.round(this.value);
};
sliderD.onChange = function() {
    foo = Math.round(this.value);
    foo2 = foo * 2;
    var idsetd = charIDToTypeID("setd");
    var desc4 = new ActionDescriptor();
    var idnull = charIDToTypeID("null");
    var ref1 = new ActionReference();
    var idfilterFX = stringIDToTypeID("filterFX");
    ref1.putIndex(idfilterFX, 1);
    var idLyr = charIDToTypeID("Lyr ");
    ref1.putName(idLyr, "Dodge and Burn");
    desc4.putReference(idnull, ref1);
    var idfilterFX = stringIDToTypeID("filterFX");
    var desc5 = new ActionDescriptor();
    var idFltr = charIDToTypeID("Fltr");
    var desc6 = new ActionDescriptor();
    var idRds = charIDToTypeID("Rds ");
    var idPxl = charIDToTypeID("#Pxl");
    desc6.putUnitDouble(idRds, idPxl, foo2);
    var idHghP = charIDToTypeID("HghP");
    desc5.putObject(idFltr, idHghP, desc6);
    var idfilterFX = stringIDToTypeID("filterFX");
    desc4.putObject(idfilterFX, idfilterFX, desc5);
    executeAction(idsetd, desc4, DialogModes.NO);
    app.refresh();
};
sliderDC.onChanging = function() {
    sliderValueDC.text = Math.round(this.value);
};
sliderDC.onChange = function() {
    foo = Math.round(this.value);
    foo = Math.round(this.value);
    var idsetd = charIDToTypeID("setd");
    var desc6629 = new ActionDescriptor();
    var idnull = charIDToTypeID("null");
    var ref2427 = new ActionReference();
    var idLyr = charIDToTypeID("Lyr ");
    ref2427.putName(idLyr, "Dodge and Burn");
    desc6629.putReference(idnull, ref2427);
    var idT = charIDToTypeID("T   ");
    var desc6630 = new ActionDescriptor();
    var idOpct = charIDToTypeID("Opct");
    var idPrc = charIDToTypeID("#Prc");
    desc6630.putUnitDouble(idOpct, idPrc, foo);
    var idLyr = charIDToTypeID("Lyr ");
    desc6629.putObject(idT, idLyr, desc6630);
    executeAction(idsetd, desc6629, DialogModes.NO);
    app.refresh();
};
baton2591 = leftGr.add("group");
baton2591.alignment = "left";
Generate55555 = baton2591.add("button", undefined, "完成 | + BW 蒙版");
Generate55555.preferredSize.width = b1L;
Generate55555.onClick = function() {
    if (app) {
        try {
            MainCatch3();
        } catch (e) {

        }
    }

    function MainCatch3() {
        if (ScriptUI.environment.keyboardState.shiftKey) {
            close = true;
            win.close();
            var idslct = charIDToTypeID("slct");
            var desc5 = new ActionDescriptor();
            var idnull = charIDToTypeID("null");
            var ref1 = new ActionReference();
            var idLyr = charIDToTypeID("Lyr ");
            ref1.putName(idLyr, "Fast Retouch | 2 Method ");
            desc5.putReference(idnull, ref1);
            var idMkVs = charIDToTypeID("MkVs");
            desc5.putBoolean(idMkVs, false);
            var idLyrI = charIDToTypeID("LyrI");
            var list1 = new ActionList();
            list1.putInteger(41);
            desc5.putList(idLyrI, list1);
            executeAction(idslct, desc5, DialogModes.NO);
            var idMrgtwo = charIDToTypeID("Mrg2");
            executeAction(idMrgtwo, undefined, DialogModes.NO);
            var idsetd = charIDToTypeID("setd");
            var desc2282 = new ActionDescriptor();
            var idnull = charIDToTypeID("null");
            var ref1187 = new ActionReference();
            var idLyr = charIDToTypeID("Lyr ");
            var idOrdn = charIDToTypeID("Ordn");
            var idTrgt = charIDToTypeID("Trgt");
            ref1187.putEnumerated(idLyr, idOrdn, idTrgt);
            desc2282.putReference(idnull, ref1187);
            var idT = charIDToTypeID("T   ");
            var desc2283 = new ActionDescriptor();
            var idNm = charIDToTypeID("Nm  ");
            desc2283.putString(idNm, "FR Method 2 | Finished");
            var idLyr = charIDToTypeID("Lyr ");
            desc2282.putObject(idT, idLyr, desc2283);
            executeAction(idsetd, desc2282, DialogModes.NO);
            var idMk = charIDToTypeID("Mk  ");
            var desc2284 = new ActionDescriptor();
            var idNw = charIDToTypeID("Nw  ");
            var idChnl = charIDToTypeID("Chnl");
            desc2284.putClass(idNw, idChnl);
            var idAt = charIDToTypeID("At  ");
            var ref1188 = new ActionReference();
            var idChnl = charIDToTypeID("Chnl");
            var idChnl = charIDToTypeID("Chnl");
            var idMsk = charIDToTypeID("Msk ");
            ref1188.putEnumerated(idChnl, idChnl, idMsk);
            desc2284.putReference(idAt, ref1188);
            var idUsng = charIDToTypeID("Usng");
            var idUsrM = charIDToTypeID("UsrM");
            var idHdAl = charIDToTypeID("HdAl");
            desc2284.putEnumerated(idUsng, idUsrM, idHdAl);
            executeAction(idMk, desc2284, DialogModes.NO);
            var idslct = charIDToTypeID("slct");
            var desc2286 = new ActionDescriptor();
            var idnull = charIDToTypeID("null");
            var ref1190 = new ActionReference();
            var idPbTl = charIDToTypeID("PbTl");
            ref1190.putClass(idPbTl);
            desc2286.putReference(idnull, ref1190);
            executeAction(idslct, desc2286, DialogModes.NO);
            var idsetd = charIDToTypeID("setd");
            var desc2289 = new ActionDescriptor();
            var idnull = charIDToTypeID("null");
            var ref1191 = new ActionReference();
            var idClr = charIDToTypeID("Clr ");
            var idFrgC = charIDToTypeID("FrgC");
            ref1191.putProperty(idClr, idFrgC);
            desc2289.putReference(idnull, ref1191);
            var idT = charIDToTypeID("T   ");
            var desc2290 = new ActionDescriptor();
            var idH = charIDToTypeID("H   ");
            var idAng = charIDToTypeID("#Ang");
            desc2290.putUnitDouble(idH, idAng, 0);
            var idStrt = charIDToTypeID("Strt");
            desc2290.putDouble(idStrt, 0);
            var idBrgh = charIDToTypeID("Brgh");
            desc2290.putDouble(idBrgh, 100);
            var idHSBC = charIDToTypeID("HSBC");
            desc2289.putObject(idT, idHSBC, desc2290);
            var idSrce = charIDToTypeID("Srce");
            desc2289.putString(idSrce, "photoshopPicker");
            executeAction(idsetd, desc2289, DialogModes.NO);
            var idsetd = charIDToTypeID("setd");
            var desc2293 = new ActionDescriptor();
            var idnull = charIDToTypeID("null");
            var ref1192 = new ActionReference();
            var idClr = charIDToTypeID("Clr ");
            var idBckC = charIDToTypeID("BckC");
            ref1192.putProperty(idClr, idBckC);
            desc2293.putReference(idnull, ref1192);
            var idT = charIDToTypeID("T   ");
            var desc2294 = new ActionDescriptor();
            var idH = charIDToTypeID("H   ");
            var idAng = charIDToTypeID("#Ang");
            desc2294.putUnitDouble(idH, idAng, 0);
            var idStrt = charIDToTypeID("Strt");
            desc2294.putDouble(idStrt, 0);
            var idBrgh = charIDToTypeID("Brgh");
            desc2294.putDouble(idBrgh, 0);
            var idHSBC = charIDToTypeID("HSBC");
            desc2293.putObject(idT, idHSBC, desc2294);
            var idSrce = charIDToTypeID("Srce");
            desc2293.putString(idSrce, "photoshopPicker");
            executeAction(idsetd, desc2293, DialogModes.NO);
        } else {
            close = true;
            win.close();
            var idslct = charIDToTypeID("slct");
            var desc5 = new ActionDescriptor();
            var idnull = charIDToTypeID("null");
            var ref1 = new ActionReference();
            var idLyr = charIDToTypeID("Lyr ");
            ref1.putName(idLyr, "Fast Retouch | 2 Method ");
            desc5.putReference(idnull, ref1);
            var idMkVs = charIDToTypeID("MkVs");
            desc5.putBoolean(idMkVs, false);
            var idLyrI = charIDToTypeID("LyrI");
            var list1 = new ActionList();
            list1.putInteger(41);
            desc5.putList(idLyrI, list1);
            executeAction(idslct, desc5, DialogModes.NO);
            var idMrgtwo = charIDToTypeID("Mrg2");
            executeAction(idMrgtwo, undefined, DialogModes.NO);
            var idsetd = charIDToTypeID("setd");
            var desc2282 = new ActionDescriptor();
            var idnull = charIDToTypeID("null");
            var ref1187 = new ActionReference();
            var idLyr = charIDToTypeID("Lyr ");
            var idOrdn = charIDToTypeID("Ordn");
            var idTrgt = charIDToTypeID("Trgt");
            ref1187.putEnumerated(idLyr, idOrdn, idTrgt);
            desc2282.putReference(idnull, ref1187);
            var idT = charIDToTypeID("T   ");
            var desc2283 = new ActionDescriptor();
            var idNm = charIDToTypeID("Nm  ");
            desc2283.putString(idNm, "FR Method 2 | Finished");
            var idLyr = charIDToTypeID("Lyr ");
            desc2282.putObject(idT, idLyr, desc2283);
            executeAction(idsetd, desc2282, DialogModes.NO);
        }
    }
};
closeBtn = leftGr.add("button", undefined, "关闭");
closeBtn.alignment = "left";
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();
}