Photoshop插件--2 分频表面模糊 |中间值--脚本开发--PS插件

文章目录


  PS是一款栅格图像编辑软件,具有许多强大的功能,本文演示如何通过脚本实现2 分频表面模糊|中间值相关功能,展示从互联网收集而来的一个小插件,供大家学习交流,请勿用于商业用途。

1.插件界面

  本文界面是一系列功能的一部分,将逐步展示,但是功能界面是共同的,如下图所示:
Photoshop插件--2 分频表面模糊 |中间值--脚本开发--PS插件

2.关键代码

  大家可通过源代码阅读,来掌握相关技巧,大部分源代码如下(代码太多无法显示,想参考的读者可以私信作者获取):


if (ScriptUI.environment.keyboardState.shiftKey) {
    if (app.documents.length > 0) {
        if (bits() == 8) {
            if (bounds()) {
                try {
                    FS_TWOFS8();
                } catch (e) {

                }
            } else {
                try {
                    FS_SIMPLE8();
                } catch (e) {

                }
            }
        } else {
            if (app.documents.length > 0) {
                if (bits() == 16) {
                    if (bounds()) {
                        try {
                            FS_TWOFS16();
                        } catch (e) {

                        }
                    } else {
                        try {
                            FS_SIMPLE16();
                        } catch (e) {

                        }
                    }
                }
            }
        }
    }

    function FS_SIMPLE8() {
        function A2FSSimpleMedian8() {
            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);
                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();
                var desc2 = new ActionDescriptor();
                var ref1 = new ActionReference();
                ref1.putEnumerated(PSClass.Channel, PSClass.Channel, PSEnum.RGB);
                ref1.putEnumerated(PSClass.Layer, PSType.Ordinal, PSEnum.Merged);
                desc2.putReference(PSKey.To, ref1);
                desc1.putObject(PSKey.With, PSClass.Calculation, desc2);
                executeAction(sTID("applyImageEvent"), 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_1");
                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, "Temp_2");
                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;
                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 step7(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_1");
                desc1.putReference(PSString.Null, ref1);
                desc1.putBoolean(PSKey.MakeVisible, false);
                executeAction(PSEvent.Select, desc1, 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, "Low");
                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(PSEvent.Median, 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.Layer, PSType.Ordinal, PSEnum.Target);
                desc1.putReference(PSString.Null, ref1);
                var desc2 = new ActionDescriptor();
                desc2.putString(PSKey.Name, "Temp_1");
                desc1.putObject(PSKey.To, PSClass.Layer, desc2);
                executeAction(PSEvent.Set, 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.putName(PSClass.Layer, "Temp_2");
                desc1.putReference(PSString.Null, ref1);
                desc1.putBoolean(PSKey.MakeVisible, false);
                executeAction(PSEvent.Select, desc1, dialogMode);
            }

            function step12(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 step13(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_1");
                desc2.putReference(PSKey.To, ref1);
                desc2.putEnumerated(PSClass.Calculation, PSType.Calculation, PSEnum.Subtract);
                desc2.putDouble(PSKey.Scale, 2);
                desc2.putInteger(PSKey.Offset, 128);
                desc1.putObject(PSKey.With, PSClass.Calculation, desc2);
                executeAction(sTID("applyImageEvent"), 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.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 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);
                executeAction(sTID("groupEvent"), desc1, dialogMode);
            }

            function step17(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_Retouch");
                desc1.putObject(PSKey.To, PSClass.Layer, desc2);
                executeAction(PSEvent.Set, 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.putEnumerated(PSClass.Layer, PSType.Ordinal, PSEnum.Target);
                desc1.putReference(PSString.Null, ref1);
                var desc2 = new ActionDescriptor();
                desc2.putEnumerated(PSKey.Mode, PSType.BlendMode, PSEnum.Normal);
                desc1.putObject(PSKey.To, PSClass.Layer, desc2);
                executeAction(PSEvent.Set, desc1, dialogMode);
            }

            function step19(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.AdjustmentLayer);
                desc1.putReference(PSString.Null, ref1);
                var desc2 = new ActionDescriptor();
                var desc3 = new ActionDescriptor();
                desc3.putEnumerated(PSString.presetKind, PSString.presetKindType, PSString.presetKindDefault);
                desc2.putObject(PSKey.Type, PSClass.Curves, desc3);
                desc1.putObject(PSKey.Using, PSClass.AdjustmentLayer, desc2);
                executeAction(PSEvent.Make, 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, PSType.Ordinal, PSEnum.Target);
                desc1.putReference(PSString.Null, ref1);
                executeAction(PSEvent.Delete, 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.Layer, PSType.Ordinal, PSEnum.Target);
                desc1.putReference(PSString.Null, ref1);
                var desc2 = new ActionDescriptor();
                desc2.putString(PSKey.Name, "Texture_Boost");
                desc1.putObject(PSKey.To, PSClass.Layer, desc2);
                executeAction(PSEvent.Set, 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.putEnumerated(PSClass.AdjustmentLayer, PSType.Ordinal, PSEnum.Target);
                desc1.putReference(PSString.Null, ref1);
                var desc2 = new ActionDescriptor();
                desc2.putEnumerated(PSString.presetKind, PSString.presetKindType, PSString.presetKindCustom);
                var list1 = new ActionList();
                var desc3 = new ActionDescriptor();
                var ref2 = new ActionReference();
                ref2.putEnumerated(PSClass.Channel, PSClass.Channel, PSEnum.Composite);
                desc3.putReference(PSClass.Channel, ref2);
                var list2 = new ActionList();
                var desc4 = new ActionDescriptor();
                desc4.putDouble(PSKey.Horizontal, 72);
                desc4.putDouble(PSKey.Vertical, 0);
                list2.putObject(PSClass.Point, desc4);
                var desc5 = new ActionDescriptor();
                desc5.putDouble(PSKey.Horizontal, 128);
                desc5.putDouble(PSKey.Vertical, 128);
                list2.putObject(PSClass.Point, desc5);
                var desc6 = new ActionDescriptor();
                desc6.putDouble(PSKey.Horizontal, 181);
                desc6.putDouble(PSKey.Vertical, 255);
                list2.putObject(PSClass.Point, desc6);
                desc3.putList(PSKey.Curve, list2);
                list1.putObject(PSClass.CurvesAdjustment, desc3);
                desc2.putList(PSKey.Adjustment, list1);
                desc1.putObject(PSKey.To, PSClass.Curves, desc2);
                executeAction(PSEvent.Set, desc1, dialogMode);
            }

            function step23(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.AdjustmentLayer, PSType.Ordinal, PSEnum.Target);
                desc1.putReference(PSString.Null, ref1);
                var desc2 = new ActionDescriptor();
                var list1 = new ActionList();
                var desc3 = new ActionDescriptor();
                var ref2 = new ActionReference();
                ref2.putEnumerated(PSClass.Channel, PSClass.Channel, PSEnum.Composite);
                desc3.putReference(PSClass.Channel, ref2);
                var list2 = new ActionList();
                var desc4 = new ActionDescriptor();
                desc4.putDouble(PSKey.Horizontal, 113);
                desc4.putDouble(PSKey.Vertical, 0);
                list2.putObject(PSClass.Point, desc4);
                var desc5 = new ActionDescriptor();
                desc5.putDouble(PSKey.Horizontal, 128);
                desc5.putDouble(PSKey.Vertical, 128);
                list2.putObject(PSClass.Point, desc5);
                var desc6 = new ActionDescriptor();
                desc6.putDouble(PSKey.Horizontal, 148);
                desc6.putDouble(PSKey.Vertical, 255);
                list2.putObject(PSClass.Point, desc6);
                desc3.putList(PSKey.Curve, list2);
                list1.putObject(PSClass.CurvesAdjustment, desc3);
                desc2.putList(PSKey.Adjustment, list1);
                desc1.putObject(PSKey.To, PSClass.Curves, desc2);
                executeAction(PSEvent.Set, desc1, dialogMode);
            }

            function step24(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 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.Layer, PSType.Ordinal, PSEnum.Target);
                desc1.putReference(PSString.Null, ref1);
                executeAction(sTID("groupEvent"), 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.putName(PSClass.Layer, "Temp_1");
                desc1.putReference(PSString.Null, ref1);
                desc1.putEnumerated(PSString.selectionModifier, PSString.selectionModifierType, PSString.addToSelectionContinuous);
                desc1.putBoolean(PSKey.MakeVisible, false);
                executeAction(PSEvent.Select, 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.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);
                executeAction(PSEvent.Make, 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.putEnumerated(PSClass.Layer, PSType.Ordinal, PSEnum.Target);
                desc1.putReference(PSString.Null, ref1);
                var desc2 = new ActionDescriptor();
                desc2.putEnumerated(PSClass.Color, PSClass.Color, PSKey.Blue);
                desc1.putObject(PSKey.To, PSClass.Layer, desc2);
                executeAction(PSEvent.Set, 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.putEnumerated(PSClass.Layer, PSType.Ordinal, PSEnum.Target);
                desc1.putReference(PSString.Null, ref1);
                var desc2 = new ActionDescriptor();
                desc2.putString(PSKey.Name, "FS_Radius_");
                desc1.putObject(PSKey.To, PSClass.Layer, desc2);
                executeAction(PSEvent.Set, 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.putName(PSClass.Layer, "Temp_1");
                desc1.putReference(PSString.Null, ref1);
                desc1.putBoolean(PSKey.MakeVisible, false);
                executeAction(PSEvent.Select, 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.putEnumerated(PSClass.Layer, PSType.Ordinal, PSEnum.Target);
                desc1.putReference(PSString.Null, ref1);
                var desc2 = new ActionDescriptor();
                desc2.putString(PSKey.Name, "Volume_R=");
                desc1.putObject(PSKey.To, PSClass.Layer, desc2);
                executeAction(PSEvent.Set, 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.putName(PSClass.Layer, "Temp_2");
                desc1.putReference(PSString.Null, ref1);
                desc1.putBoolean(PSKey.MakeVisible, false);
                executeAction(PSEvent.Select, 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.putEnumerated(PSClass.Layer, PSType.Ordinal, PSEnum.Target);
                desc1.putReference(PSString.Null, ref1);
                var desc2 = new ActionDescriptor();
                desc2.putString(PSKey.Name, "Texture_R=");
                desc1.putObject(PSKey.To, PSClass.Layer, desc2);
                executeAction(PSEvent.Set, desc1, dialogMode);
            }

            function step34(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_R=Manual");
                desc1.putObject(PSKey.To, PSClass.Layer, desc2);
                executeAction(PSEvent.Set, 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, "FS_Radius_");
                desc1.putReference(PSString.Null, ref1);
                desc1.putBoolean(PSKey.MakeVisible, false);
                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();
                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, "2 F-S Median 8 bits");
                desc1.putObject(PSKey.To, PSClass.Layer, desc2);
                executeAction(PSEvent.Set, desc1, dialogMode);
            }

            function step37(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_R=");
                desc1.putReference(PSString.Null, ref1);
                desc1.putBoolean(PSKey.MakeVisible, false);
                executeAction(PSEvent.Select, 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.putEnumerated(PSClass.Layer, PSType.Ordinal, PSEnum.Target);
                desc1.putReference(PSString.Null, ref1);
                var desc2 = new ActionDescriptor();
                desc2.putString(PSKey.Name, "Volume_R=Manual");
                desc1.putObject(PSKey.To, PSClass.Layer, desc2);
                executeAction(PSEvent.Set, desc1, dialogMode);
            }

            function step39(enabled, withDialog) {
                if (enabled != undefined && !enabled) {
                    return;
                }
                var dialogMode = withDialog ? DialogModes.ALL : DialogModes.NO;
                executeAction(sTID("copyToLayer"), 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.putEnumerated(PSClass.Layer, PSType.Ordinal, PSEnum.Target);
                desc1.putReference(PSString.Null, ref1);
                var desc2 = new ActionDescriptor();
                desc2.putString(PSKey.Name, "Volume_Retouch");
                desc1.putObject(PSKey.To, PSClass.Layer, desc2);
                executeAction(PSEvent.Set, 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(cTID("MixB"));
                desc1.putReference(PSString.Null, ref1);
                executeAction(PSEvent.Select, desc1, dialogMode);
            }
            step1();
            step2();
            step3();
            step4();
            step5();
            step6();
            step7();
            step8();
            step9(true, true);
            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();
        }
        cTID = function(s) {
            return app.charIDToTypeID(s);
        };
        sTID = function(s) {
            return app.stringIDToTypeID(s);
        };
        A2FSSimpleMedian8.loadSymbols = function() {
            var dbgLevel = $.level;
            $.level = 0;
            try {
                PSConstants;
                return;
            } catch (e) {

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

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

                };
                PSEnum = function() {

                };
                PSEvent = function() {

                };
                PSForm = function() {

                };
                PSKey = function() {

                };
                PSType = function() {

                };
                PSUnit = function() {

                };
                PSString = function() {

                };
            }
            PSClass.AdjustmentLayer = cTID("AdjL");
            PSClass.Calculation = cTID("Clcl");
            PSClass.Channel = cTID("Chnl");
            PSClass.Color = cTID("Clr ");
            PSClass.Curves = cTID("Crvs");
            PSClass.CurvesAdjustment = cTID("CrvA");
            PSClass.Invert = cTID("Invr");
            PSClass.Layer = cTID("Lyr ");
            PSClass.Mask = cTID("Msk ");
            PSClass.Point = cTID("Pnt ");
            PSClass.RGBColor = cTID("RGBC");
            PSEnum.Add = cTID("Add ");
            PSEnum.Composite = cTID("Cmps");
            PSEnum.ForegroundColor = cTID("FrgC");
            PSEnum.Gray = cTID("Gry ");
            PSEnum.Merged = cTID("Mrgd");
            PSEnum.None = cTID("None");
            PSEnum.Normal = cTID("Nrml");
            PSEnum.RGB = cTID("RGB ");
            PSEnum.RevealAll = cTID("RvlA");
            PSEnum.Subtract = cTID("Sbtr");
            PSEnum.Target = cTID("Trgt");
            PSEnum.Transparency = cTID("Trsp");
            PSEvent.Delete = cTID("Dlt ");
            PSEvent.Fill = cTID("Fl  ");
            PSEvent.Hide = cTID("Hd  ");
            PSEvent.Make = cTID("Mk  ");
            PSEvent.Median = cTID("Mdn ");
            PSEvent.Select = cTID("slct");
            PSEvent.Set = cTID("setd");
            PSEvent.Show = cTID("Shw ");
            PSKey.Adjustment = cTID("Adjs");
            PSKey.At = cTID("At  ");
            PSKey.Blue = cTID("Bl  ");
            PSKey.Curve = cTID("Crv ");
            PSKey.From = cTID("From");
            PSKey.Green = cTID("Grn ");
            PSKey.Horizontal = cTID("Hrzn");
            PSKey.MakeVisible = cTID("MkVs");
            PSKey.Mode = cTID("Md  ");
            PSKey.Name = cTID("Nm  ");
            PSKey.New = cTID("Nw  ");
            PSKey.Offset = cTID("Ofst");
            PSKey.Opacity = cTID("Opct");
            PSKey.Radius = cTID("Rds ");
            PSKey.Red = cTID("Rd  ");
            PSKey.Scale = cTID("Scl ");
            PSKey.Source = cTID("Srce");
            PSKey.To = cTID("T   ");
            PSKey.Type = cTID("Type");
            PSKey.Using = cTID("Usng");
            PSKey.Vertical = cTID("Vrtc");
            PSKey.With = cTID("With");
            PSString.Null = sTID("null");
            PSString.addToSelectionContinuous = sTID("addToSelectionContinuous");
            PSString.layerGroup = sTID("layerSection");
            PSString.linearLight = sTID("linearLight");
            PSString.presetKind = sTID("presetKind");
            PSString.presetKindCustom = sTID("presetKindCustom");
            PSString.presetKindDefault = sTID("presetKindDefault");
            PSString.presetKindType = sTID("presetKindType");
            PSString.selection = sTID("selection");
            PSString.selectionModifier = sTID("selectionModifier");
            PSString.selectionModifierType = sTID("selectionModifierType");
            PSType.BlendMode = cTID("BlnM");
            PSType.Calculation = cTID("Clcn");
            PSType.FillContents = cTID("FlCn");
            PSType.Ordinal = cTID("Ordn");
            PSType.UserMaskOptions = cTID("UsrM");
            PSUnit.Percent = cTID("#Prc");
            PSUnit.Pixels = cTID("#Pxl");
        };
        A2FSSimpleMedian8.loadSymbols();
        A2FSSimpleMedian8.main = function() {
            A2FSSimpleMedian8();
        };
        A2FSSimpleMedian8.main();
    }

    function FS_TWOFS8() {
        function A2FSManualTwoFS8Median() {
            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);
                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.putEnumerated(PSKey.Using, PSType.FillContents, PSEnum.Gray);
                desc1.putUnitDouble(PSKey.Opacity, PSUnit.Percent, 100);
                desc1.putEnumerated(PSKey.Mode, PSType.BlendMode, PSEnum.Normal);
                executeAction(PSEvent.Fill, 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.putProperty(PSClass.Channel, PSString.selection);
                desc1.putReference(PSString.Null, ref1);
                desc1.putEnumerated(PSKey.To, PSType.Ordinal, PSEnum.None);
                executeAction(PSEvent.Set, desc1, dialogMode);
            }

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

            function step5(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 step6(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 step7(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.putEnumerated(PSClass.Layer, PSType.Ordinal, PSEnum.Merged);
                desc2.putReference(PSKey.To, ref1);
                desc1.putObject(PSKey.With, PSClass.Calculation, desc2);
                executeAction(sTID("applyImageEvent"), desc1, 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, "Temp_1");
                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;
                executeAction(sTID("copyToLayer"), undefined, 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.Layer, PSType.Ordinal, PSEnum.Target);
                desc1.putReference(PSString.Null, ref1);
                var desc2 = new ActionDescriptor();
                desc2.putString(PSKey.Name, "Temp_2");
                desc1.putObject(PSKey.To, PSClass.Layer, desc2);
                executeAction(PSEvent.Set, desc1, dialogMode);
            }

            function step11(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 step12(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_1");
                desc1.putReference(PSString.Null, ref1);
                desc1.putBoolean(PSKey.MakeVisible, false);
                executeAction(PSEvent.Select, desc1, dialogMode);
            }

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

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

            function step15(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_Selection");
                desc1.putReference(PSString.Null, ref1);
                desc1.putBoolean(PSKey.MakeVisible, false);
                executeAction(PSEvent.Select, desc1, 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.putProperty(PSClass.Channel, PSString.selection);
                desc1.putReference(PSString.Null, ref1);
                var ref2 = new ActionReference();
                ref2.putEnumerated(PSClass.Channel, PSClass.Channel, PSEnum.Transparency);
                desc1.putReference(PSKey.To, ref2);
                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 ref1 = new ActionReference();
                ref1.putEnumerated(PSClass.Layer, PSType.Ordinal, PSEnum.Target);
                desc1.putReference(PSString.Null, ref1);
                executeAction(PSEvent.Delete, 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, "Low");
                desc1.putReference(PSString.Null, ref1);
                desc1.putBoolean(PSKey.MakeVisible, false);
                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();
                var ref1 = new ActionReference();
                ref1.putEnumerated(PSClass.Channel, PSClass.Channel, PSClass.Mask);
                desc1.putReference(PSString.Null, ref1);
                desc1.putBoolean(PSKey.MakeVisible, false);
                executeAction(PSEvent.Select, 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.putProperty(PSClass.Color, PSEnum.ForegroundColor);
                desc1.putReference(PSString.Null, ref1);
                var desc2 = new ActionDescriptor();
                desc2.putDouble(PSKey.Red, 127.996108949416);
                desc2.putDouble(PSKey.Green, 127.996108949416);
                desc2.putDouble(PSKey.Blue, 127.996108949416);
                desc1.putObject(PSKey.To, PSClass.RGBColor, desc2);
                desc1.putString(PSKey.Source, "photoshopPicker");
                executeAction(PSEvent.Set, desc1, dialogMode);
            }

            function step21(enabled, withDialog) {
                if (enabled != undefined && !enabled) {
                    return;
                }
                var dialogMode = withDialog ? DialogModes.ALL : DialogModes.NO;
                var desc1 = new ActionDescriptor();
                desc1.putEnumerated(PSKey.Using, PSType.FillContents, PSEnum.Gray);
                desc1.putUnitDouble(PSKey.Opacity, PSUnit.Percent, 100);
                desc1.putEnumerated(PSKey.Mode, PSType.BlendMode, PSEnum.Normal);
                executeAction(PSEvent.Fill, 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.putClass(PSClass.AdjustmentLayer);
                desc1.putReference(PSString.Null, ref1);
                var desc2 = new ActionDescriptor();
                desc2.putClass(PSKey.Type, PSClass.Invert);
                desc1.putObject(PSKey.Using, PSClass.AdjustmentLayer, desc2);
                executeAction(PSEvent.Make, desc1, dialogMode);
            }

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

            function step24(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_Invert");
                desc1.putObject(PSKey.To, PSClass.Layer, desc2);
                executeAction(PSEvent.Set, 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.Layer, PSType.Ordinal, PSEnum.Target);
                desc1.putReference(PSString.Null, ref1);
                executeAction(sTID("groupEvent"), 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.putName(PSClass.Layer, "Low");
                desc1.putReference(PSString.Null, ref1);
                desc1.putBoolean(PSKey.MakeVisible, false);
                executeAction(PSEvent.Select, desc1, dialogMode);
            }

            function step27(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(PSEvent.Median, 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.putEnumerated(PSClass.Layer, PSType.Ordinal, PSEnum.Target);
                desc1.putReference(PSString.Null, ref1);
                var desc2 = new ActionDescriptor();
                desc2.putString(PSKey.Name, "Temp_1");
                desc1.putObject(PSKey.To, PSClass.Layer, desc2);
                executeAction(PSEvent.Set, 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.putEnumerated(PSClass.Channel, PSClass.Channel, PSClass.Mask);
                desc1.putReference(PSString.Null, ref1);
                desc1.putBoolean(PSKey.MakeVisible, false);
                executeAction(PSEvent.Select, 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.Channel, PSType.Ordinal, PSEnum.Target);
                desc1.putReference(PSString.Null, ref1);
                executeAction(PSEvent.Delete, 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.putName(PSClass.Layer, "Temp_Invert");
                desc1.putReference(PSString.Null, ref1);
                desc1.putBoolean(PSKey.MakeVisible, false);
                executeAction(PSEvent.Select, 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);
                executeAction(PSEvent.Delete, 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_2");
                desc1.putReference(PSString.Null, ref1);
                desc1.putBoolean(PSKey.MakeVisible, false);
                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();
                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 step35(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_1");
                desc2.putReference(PSKey.To, ref1);
                desc2.putEnumerated(PSClass.Calculation, PSType.Calculation, PSEnum.Subtract);
                desc2.putDouble(PSKey.Scale, 2);
                desc2.putInteger(PSKey.Offset, 128);
                desc1.putObject(PSKey.With, PSClass.Calculation, desc2);
                executeAction(sTID("applyImageEvent"), desc1, dialogMode);
            }

            function step36(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 step37(enabled, withDialog) {
                if (enabled != undefined && !enabled) {
                    return;
                }
                var dialogMode = withDialog ? DialogModes.ALL : DialogModes.NO;
                executeAction(sTID("copyToLayer"), undefined, 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.putEnumerated(PSClass.Layer, PSType.Ordinal, PSEnum.Target);
                desc1.putReference(PSString.Null, ref1);
                executeAction(sTID("groupEvent"), desc1, dialogMode);
            }

            function step39(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_Retouch");
                desc1.putObject(PSKey.To, PSClass.Layer, desc2);
                executeAction(PSEvent.Set, desc1, 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.putEnumerated(PSClass.Layer, PSType.Ordinal, PSEnum.Target);
                desc1.putReference(PSString.Null, ref1);
                var desc2 = new ActionDescriptor();
                desc2.putEnumerated(PSKey.Mode, PSType.BlendMode, PSEnum.Normal);
                desc1.putObject(PSKey.To, PSClass.Layer, desc2);
                executeAction(PSEvent.Set, 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.AdjustmentLayer);
                desc1.putReference(PSString.Null, ref1);
                var desc2 = new ActionDescriptor();
                var desc3 = new ActionDescriptor();
                desc3.putEnumerated(PSString.presetKind, PSString.presetKindType, PSString.presetKindDefault);
                desc2.putObject(PSKey.Type, PSClass.Curves, desc3);
                desc1.putObject(PSKey.Using, PSClass.AdjustmentLayer, desc2);
                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 ref1 = new ActionReference();
                ref1.putEnumerated(PSClass.Channel, PSType.Ordinal, PSEnum.Target);
                desc1.putReference(PSString.Null, ref1);
                executeAction(PSEvent.Delete, 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, "Texture_Boost");
                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;
                var desc1 = new ActionDescriptor();
                var ref1 = new ActionReference();
                ref1.putEnumerated(PSClass.AdjustmentLayer, PSType.Ordinal, PSEnum.Target);
                desc1.putReference(PSString.Null, ref1);
                var desc2 = new ActionDescriptor();
                desc2.putEnumerated(PSString.presetKind, PSString.presetKindType, PSString.presetKindCustom);
                var list1 = new ActionList();
                var desc3 = new ActionDescriptor();
                var ref2 = new ActionReference();
                ref2.putEnumerated(PSClass.Channel, PSClass.Channel, PSEnum.Composite);
                desc3.putReference(PSClass.Channel, ref2);
                var list2 = new ActionList();
                var desc4 = new ActionDescriptor();
                desc4.putDouble(PSKey.Horizontal, 72);
                desc4.putDouble(PSKey.Vertical, 0);
                list2.putObject(PSClass.Point, desc4);
                var desc5 = new ActionDescriptor();
                desc5.putDouble(PSKey.Horizontal, 128);
                desc5.putDouble(PSKey.Vertical, 128);
                list2.putObject(PSClass.Point, desc5);
                var desc6 = new ActionDescriptor();
                desc6.putDouble(PSKey.Horizontal, 181);
                desc6.putDouble(PSKey.Vertical, 255);
                list2.putObject(PSClass.Point, desc6);
                desc3.putList(PSKey.Curve, list2);
                list1.putObject(PSClass.CurvesAdjustment, desc3);
                desc2.putList(PSKey.Adjustment, list1);
                desc1.putObject(PSKey.To, PSClass.Curves, desc2);
                executeAction(PSEvent.Set, desc1, dialogMode);
            }

            function step45(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.AdjustmentLayer, PSType.Ordinal, PSEnum.Target);
                desc1.putReference(PSString.Null, ref1);
                var desc2 = new ActionDescriptor();
                var list1 = new ActionList();
                var desc3 = new ActionDescriptor();
                var ref2 = new ActionReference();
                ref2.putEnumerated(PSClass.Channel, PSClass.Channel, PSEnum.Composite);
                desc3.putReference(PSClass.Channel, ref2);
                var list2 = new ActionList();
                var desc4 = new ActionDescriptor();
                desc4.putDouble(PSKey.Horizontal, 113);
                desc4.putDouble(PSKey.Vertical, 0);
                list2.putObject(PSClass.Point, desc4);
                var desc5 = new ActionDescriptor();
                desc5.putDouble(PSKey.Horizontal, 128);
                desc5.putDouble(PSKey.Vertical, 128);
                list2.putObject(PSClass.Point, desc5);
                var desc6 = new ActionDescriptor();
                desc6.putDouble(PSKey.Horizontal, 148);
                desc6.putDouble(PSKey.Vertical, 255);
                list2.putObject(PSClass.Point, desc6);
                desc3.putList(PSKey.Curve, list2);
                list1.putObject(PSClass.CurvesAdjustment, desc3);
                desc2.putList(PSKey.Adjustment, list1);
                desc1.putObject(PSKey.To, PSClass.Curves, desc2);
                executeAction(PSEvent.Set, desc1, dialogMode);
            }

            function step46(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 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.Layer, PSType.Ordinal, PSEnum.Target);
                desc1.putReference(PSString.Null, ref1);
                executeAction(sTID("groupEvent"), 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.putName(PSClass.Layer, "Temp_1");
                desc1.putReference(PSString.Null, ref1);
                desc1.putEnumerated(PSString.selectionModifier, PSString.selectionModifierType, PSString.addToSelectionContinuous);
                desc1.putBoolean(PSKey.MakeVisible, false);
                executeAction(PSEvent.Select, desc1, dialogMode);
            }

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

            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.putEnumerated(PSClass.Layer, PSType.Ordinal, PSEnum.Target);
                desc1.putReference(PSString.Null, ref1);
                var desc2 = new ActionDescriptor();
                desc2.putEnumerated(PSClass.Color, PSClass.Color, PSKey.Blue);
                desc1.putObject(PSKey.To, PSClass.Layer, desc2);
                executeAction(PSEvent.Set, 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 desc2 = new ActionDescriptor();
                desc2.putString(PSKey.Name, "FS_Radius_");
                desc1.putObject(PSKey.To, PSClass.Layer, desc2);
                executeAction(PSEvent.Set, desc1, dialogMode);
            }

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

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

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

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

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

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

            function step58(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, "2 F-S Median 8 bits");
                desc1.putObject(PSKey.To, PSClass.Layer, desc2);
                executeAction(PSEvent.Set, desc1, dialogMode);
            }

            function step59(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_R=");
                desc1.putReference(PSString.Null, ref1);
                desc1.putBoolean(PSKey.MakeVisible, false);
                executeAction(PSEvent.Select, desc1, dialogMode);
            }

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

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

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

            function step63(enabled, withDialog) {
                if (enabled != undefined && !enabled) {
                    return;
                }
                var dialogMode = withDialog ? DialogModes.ALL : DialogModes.NO;
                var desc1 = new ActionDescriptor();
                var ref1 = new ActionReference();
                ref1.putClass(cTID("MixB"));
                desc1.putReference(PSString.Null, ref1);
                executeAction(PSEvent.Select, 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(true, true);
            step28();
            step29();
            step30();
            step31();
            step32();
            step33();
            step34();
            step35();
            step36();
            step37();
            step38();
            step39();
            step40();
            step41();
            step42();
            step43();
            step44();
            step45();
            step46();
            step47();
            step48();
            step49();
            step50();
            step51();
            step52();
            step53();
            step54();
            step55();
            step56();
            step57();
            step58();
            step59();
            step60();
            step61();
            step62();
            step63();
        }
        cTID = function(s) {
            return app.charIDToTypeID(s);
        };
        sTID = function(s) {
            return app.stringIDToTypeID(s);
        };
        A2FSManualTwoFS8Median.loadSymbols = function() {
            var dbgLevel = $.level;
            $.level = 0;
            try {
                PSConstants;
                return;
            } catch (e) {

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

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

                };
                PSEnum = function() {

                };
                PSEvent = function() {

                };
                PSForm = function() {

                };
                PSKey = function() {

                };
                PSType = function() {

                };
                PSUnit = function() {

                };
                PSString = function() {

                };
            }
            PSClass.AdjustmentLayer = cTID("AdjL");
            PSClass.Calculation = cTID("Clcl");
            PSClass.Channel = cTID("Chnl");
            PSClass.Color = cTID("Clr ");
            PSClass.Curves = cTID("Crvs");
            PSClass.CurvesAdjustment = cTID("CrvA");
            PSClass.Invert = cTID("Invr");
            PSClass.Layer = cTID("Lyr ");
            PSClass.Mask = cTID("Msk ");
            PSClass.Point = cTID("Pnt ");
            PSClass.RGBColor = cTID("RGBC");
            PSEnum.Composite = cTID("Cmps");
            PSEnum.ForegroundColor = cTID("FrgC");
            PSEnum.Gray = cTID("Gry ");
            PSEnum.Merged = cTID("Mrgd");
            PSEnum.None = cTID("None");
            PSEnum.Normal = cTID("Nrml");
            PSEnum.RGB = cTID("RGB ");
            PSEnum.RevealAll = cTID("RvlA");
            PSEnum.Subtract = cTID("Sbtr");
            PSEnum.Target = cTID("Trgt");
            PSEnum.Transparency = cTID("Trsp");
            PSEvent.Delete = cTID("Dlt ");
            PSEvent.Fill = cTID("Fl  ");
            PSEvent.Hide = cTID("Hd  ");
            PSEvent.Make = cTID("Mk  ");
            PSEvent.Median = cTID("Mdn ");
            PSEvent.Select = cTID("slct");
            PSEvent.Set = cTID("setd");
            PSEvent.Show = cTID("Shw ");
            PSKey.Adjustment = cTID("Adjs");
            PSKey.At = cTID("At  ");
            PSKey.Blue = cTID("Bl  ");
            PSKey.Curve = cTID("Crv ");
            PSKey.From = cTID("From");
            PSKey.Green = cTID("Grn ");
            PSKey.Horizontal = cTID("Hrzn");
            PSKey.MakeVisible = cTID("MkVs");
            PSKey.Mode = cTID("Md  ");
            PSKey.Name = cTID("Nm  ");
            PSKey.New = cTID("Nw  ");
            PSKey.Offset = cTID("Ofst");
            PSKey.Opacity = cTID("Opct");
            PSKey.Radius = cTID("Rds ");
            PSKey.Red = cTID("Rd  ");
            PSKey.Scale = cTID("Scl ");
            PSKey.Source = cTID("Srce");
            PSKey.To = cTID("T   ");
            PSKey.Type = cTID("Type");
            PSKey.Using = cTID("Usng");
            PSKey.Vertical = cTID("Vrtc");
            PSKey.With = cTID("With");
            PSString.Null = sTID("null");
            PSString.addToSelectionContinuous = sTID("addToSelectionContinuous");
            PSString.layerGroup = sTID("layerSection");
            PSString.linearLight = sTID("linearLight");
            PSString.presetKind = sTID("presetKind");
            PSString.presetKindCustom = sTID("presetKindCustom");
            PSString.presetKindDefault = sTID("presetKindDefault");
            PSString.presetKindType = sTID("presetKindType");
            PSString.selection = sTID("selection");
            PSString.selectionModifier = sTID("selectionModifier");
            PSString.selectionModifierType = sTID("selectionModifierType");
            PSType.BlendMode = cTID("BlnM");
            PSType.Calculation = cTID("Clcn");
            PSType.FillContents = cTID("FlCn");
            PSType.Ordinal = cTID("Ordn");
            PSType.UserMaskOptions = cTID("UsrM");
            PSUnit.Percent = cTID("#Prc");
            PSUnit.Pixels = cTID("#Pxl");
        };
        A2FSManualTwoFS8Median.loadSymbols();
        A2FSManualTwoFS8Median.main = function() {
            A2FSManualTwoFS8Median();
        };
        A2FSManualTwoFS8Median.main();
    }

    function FS_SIMPLE16() {
        function A2FSSimpleMedian16() {
            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);
                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();
                var desc2 = new ActionDescriptor();
                var ref1 = new ActionReference();
                ref1.putEnumerated(PSClass.Channel, PSClass.Channel, PSEnum.RGB);
                ref1.putEnumerated(PSClass.Layer, PSType.Ordinal, PSEnum.Merged);
                desc2.putReference(PSKey.To, ref1);
                desc1.putObject(PSKey.With, PSClass.Calculation, desc2);
                executeAction(sTID("applyImageEvent"), 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_1");
                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, "Temp_2");
                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;
                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 step7(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_1");
                desc1.putReference(PSString.Null, ref1);
                desc1.putBoolean(PSKey.MakeVisible, false);
                executeAction(PSEvent.Select, desc1, 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, "Low");
                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(PSEvent.Median, 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.Layer, PSType.Ordinal, PSEnum.Target);
                desc1.putReference(PSString.Null, ref1);
                var desc2 = new ActionDescriptor();
                desc2.putString(PSKey.Name, "Temp_1");
                desc1.putObject(PSKey.To, PSClass.Layer, desc2);
                executeAction(PSEvent.Set, 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.putName(PSClass.Layer, "Temp_2");
                desc1.putReference(PSString.Null, ref1);
                desc1.putBoolean(PSKey.MakeVisible, false);
                executeAction(PSEvent.Select, desc1, dialogMode);
            }

            function step12(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 step13(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_1");
                desc2.putReference(PSKey.To, ref1);
                desc2.putBoolean(PSClass.Invert, true);
                desc2.putEnumerated(PSClass.Calculation, PSType.Calculation, PSEnum.Add);
                desc2.putDouble(PSKey.Scale, 2);
                desc2.putInteger(PSKey.Offset, 0);
                desc1.putObject(PSKey.With, PSClass.Calculation, desc2);
                executeAction(sTID("applyImageEvent"), 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.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 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);
                executeAction(sTID("groupEvent"), desc1, dialogMode);
            }

            function step17(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_Retouch");
                desc1.putObject(PSKey.To, PSClass.Layer, desc2);
                executeAction(PSEvent.Set, 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.putEnumerated(PSClass.Layer, PSType.Ordinal, PSEnum.Target);
                desc1.putReference(PSString.Null, ref1);
                var desc2 = new ActionDescriptor();
                desc2.putEnumerated(PSKey.Mode, PSType.BlendMode, PSEnum.Normal);
                desc1.putObject(PSKey.To, PSClass.Layer, desc2);
                executeAction(PSEvent.Set, desc1, dialogMode);
            }

            function step19(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.AdjustmentLayer);
                desc1.putReference(PSString.Null, ref1);
                var desc2 = new ActionDescriptor();
                var desc3 = new ActionDescriptor();
                desc3.putEnumerated(PSString.presetKind, PSString.presetKindType, PSString.presetKindDefault);
                desc2.putObject(PSKey.Type, PSClass.Curves, desc3);
                desc1.putObject(PSKey.Using, PSClass.AdjustmentLayer, desc2);
                executeAction(PSEvent.Make, 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, PSType.Ordinal, PSEnum.Target);
                desc1.putReference(PSString.Null, ref1);
                executeAction(PSEvent.Delete, 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.Layer, PSType.Ordinal, PSEnum.Target);
                desc1.putReference(PSString.Null, ref1);
                var desc2 = new ActionDescriptor();
                desc2.putString(PSKey.Name, "Texture_Boost");
                desc1.putObject(PSKey.To, PSClass.Layer, desc2);
                executeAction(PSEvent.Set, 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.putEnumerated(PSClass.AdjustmentLayer, PSType.Ordinal, PSEnum.Target);
                desc1.putReference(PSString.Null, ref1);
                var desc2 = new ActionDescriptor();
                desc2.putEnumerated(PSString.presetKind, PSString.presetKindType, PSString.presetKindCustom);
                var list1 = new ActionList();
                var desc3 = new ActionDescriptor();
                var ref2 = new ActionReference();
                ref2.putEnumerated(PSClass.Channel, PSClass.Channel, PSEnum.Composite);
                desc3.putReference(PSClass.Channel, ref2);
                var list2 = new ActionList();
                var desc4 = new ActionDescriptor();
                desc4.putDouble(PSKey.Horizontal, 72);
                desc4.putDouble(PSKey.Vertical, 0);
                list2.putObject(PSClass.Point, desc4);
                var desc5 = new ActionDescriptor();
                desc5.putDouble(PSKey.Horizontal, 128);
                desc5.putDouble(PSKey.Vertical, 128);
                list2.putObject(PSClass.Point, desc5);
                var desc6 = new ActionDescriptor();
                desc6.putDouble(PSKey.Horizontal, 181);
                desc6.putDouble(PSKey.Vertical, 255);
                list2.putObject(PSClass.Point, desc6);
                desc3.putList(PSKey.Curve, list2);
                list1.putObject(PSClass.CurvesAdjustment, desc3);
                desc2.putList(PSKey.Adjustment, list1);
                desc1.putObject(PSKey.To, PSClass.Curves, desc2);
                executeAction(PSEvent.Set, desc1, dialogMode);
            }

            function step23(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.AdjustmentLayer, PSType.Ordinal, PSEnum.Target);
                desc1.putReference(PSString.Null, ref1);
                var desc2 = new ActionDescriptor();
                var list1 = new ActionList();
                var desc3 = new ActionDescriptor();
                var ref2 = new ActionReference();
                ref2.putEnumerated(PSClass.Channel, PSClass.Channel, PSEnum.Composite);
                desc3.putReference(PSClass.Channel, ref2);
                var list2 = new ActionList();
                var desc4 = new ActionDescriptor();
                desc4.putDouble(PSKey.Horizontal, 113);
                desc4.putDouble(PSKey.Vertical, 0);
                list2.putObject(PSClass.Point, desc4);
                var desc5 = new ActionDescriptor();
                desc5.putDouble(PSKey.Horizontal, 128);
                desc5.putDouble(PSKey.Vertical, 128);
                list2.putObject(PSClass.Point, desc5);
                var desc6 = new ActionDescriptor();
                desc6.putDouble(PSKey.Horizontal, 148);
                desc6.putDouble(PSKey.Vertical, 255);
                list2.putObject(PSClass.Point, desc6);
                desc3.putList(PSKey.Curve, list2);
                list1.putObject(PSClass.CurvesAdjustment, desc3);
                desc2.putList(PSKey.Adjustment, list1);
                desc1.putObject(PSKey.To, PSClass.Curves, desc2);
                executeAction(PSEvent.Set, desc1, dialogMode);
            }

            function step24(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 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.Layer, PSType.Ordinal, PSEnum.Target);
                desc1.putReference(PSString.Null, ref1);
                executeAction(sTID("groupEvent"), 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.putName(PSClass.Layer, "Temp_1");
                desc1.putReference(PSString.Null, ref1);
                desc1.putEnumerated(PSString.selectionModifier, PSString.selectionModifierType, PSString.addToSelectionContinuous);
                desc1.putBoolean(PSKey.MakeVisible, false);
                executeAction(PSEvent.Select, 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.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);
                executeAction(PSEvent.Make, 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.putEnumerated(PSClass.Layer, PSType.Ordinal, PSEnum.Target);
                desc1.putReference(PSString.Null, ref1);
                var desc2 = new ActionDescriptor();
                desc2.putEnumerated(PSClass.Color, PSClass.Color, PSKey.Blue);
                desc1.putObject(PSKey.To, PSClass.Layer, desc2);
                executeAction(PSEvent.Set, 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.putEnumerated(PSClass.Layer, PSType.Ordinal, PSEnum.Target);
                desc1.putReference(PSString.Null, ref1);
                var desc2 = new ActionDescriptor();
                desc2.putString(PSKey.Name, "FS_Radius_");
                desc1.putObject(PSKey.To, PSClass.Layer, desc2);
                executeAction(PSEvent.Set, 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.putName(PSClass.Layer, "Temp_1");
                desc1.putReference(PSString.Null, ref1);
                desc1.putBoolean(PSKey.MakeVisible, false);
                executeAction(PSEvent.Select, 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.putEnumerated(PSClass.Layer, PSType.Ordinal, PSEnum.Target);
                desc1.putReference(PSString.Null, ref1);
                var desc2 = new ActionDescriptor();
                desc2.putString(PSKey.Name, "Volume_R=");
                desc1.putObject(PSKey.To, PSClass.Layer, desc2);
                executeAction(PSEvent.Set, 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.putName(PSClass.Layer, "Temp_2");
                desc1.putReference(PSString.Null, ref1);
                desc1.putBoolean(PSKey.MakeVisible, false);
                executeAction(PSEvent.Select, 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.putEnumerated(PSClass.Layer, PSType.Ordinal, PSEnum.Target);
                desc1.putReference(PSString.Null, ref1);
                var desc2 = new ActionDescriptor();
                desc2.putString(PSKey.Name, "Texture_R=");
                desc1.putObject(PSKey.To, PSClass.Layer, desc2);
                executeAction(PSEvent.Set, desc1, dialogMode);
            }

            function step34(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_R=Manual");
                desc1.putObject(PSKey.To, PSClass.Layer, desc2);
                executeAction(PSEvent.Set, 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, "FS_Radius_");
                desc1.putReference(PSString.Null, ref1);
                desc1.putBoolean(PSKey.MakeVisible, false);
                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();
                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, "2 F-S Gaussian 16 bits");
                desc1.putObject(PSKey.To, PSClass.Layer, desc2);
                executeAction(PSEvent.Set, desc1, dialogMode);
            }

            function step37(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, "2 F-S Median 16 bits");
                desc1.putObject(PSKey.To, PSClass.Layer, desc2);
                executeAction(PSEvent.Set, 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, "Volume_R=");
                desc1.putReference(PSString.Null, ref1);
                desc1.putBoolean(PSKey.MakeVisible, false);
                executeAction(PSEvent.Select, desc1, dialogMode);
            }

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

            function step40(enabled, withDialog) {
                if (enabled != undefined && !enabled) {
                    return;
                }
                var dialogMode = withDialog ? DialogModes.ALL : DialogModes.NO;
                executeAction(sTID("copyToLayer"), undefined, 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.putEnumerated(PSClass.Layer, PSType.Ordinal, PSEnum.Target);
                desc1.putReference(PSString.Null, ref1);
                var desc2 = new ActionDescriptor();
                desc2.putString(PSKey.Name, "Volume_Retouch");
                desc1.putObject(PSKey.To, PSClass.Layer, desc2);
                executeAction(PSEvent.Set, desc1, dialogMode);
            }

            function step42(enabled, withDialog) {
                if (enabled != undefined && !enabled) {
                    return;
                }
                var dialogMode = withDialog ? DialogModes.ALL : DialogModes.NO;
                var desc1 = new ActionDescriptor();
                var ref1 = new ActionReference();
                ref1.putClass(cTID("MixB"));
                desc1.putReference(PSString.Null, ref1);
                executeAction(PSEvent.Select, desc1, dialogMode);
            }
            step1();
            step2();
            step3();
            step4();
            step5();
            step6();
            step7();
            step8();
            step9(true, true);
            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();
        }
        cTID = function(s) {
            return app.charIDToTypeID(s);
        };
        sTID = function(s) {
            return app.stringIDToTypeID(s);
        };
        A2FSSimpleMedian16.loadSymbols = function() {
            var dbgLevel = $.level;
            $.level = 0;
            try {
                PSConstants;
                return;
            } catch (e) {

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

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

                };
                PSEnum = function() {

                };
                PSEvent = function() {

                };
                PSForm = function() {

                };
                PSKey = function() {

                };
                PSType = function() {

                };
                PSUnit = function() {

                };
                PSString = function() {

                };
            }
            PSClass.AdjustmentLayer = cTID("AdjL");
            PSClass.Calculation = cTID("Clcl");
            PSClass.Channel = cTID("Chnl");
            PSClass.Color = cTID("Clr ");
            PSClass.Curves = cTID("Crvs");
            PSClass.CurvesAdjustment = cTID("CrvA");
            PSClass.Invert = cTID("Invr");
            PSClass.Layer = cTID("Lyr ");
            PSClass.Mask = cTID("Msk ");
            PSClass.Point = cTID("Pnt ");
            PSClass.RGBColor = cTID("RGBC");
            PSEnum.Add = cTID("Add ");
            PSEnum.Composite = cTID("Cmps");
            PSEnum.ForegroundColor = cTID("FrgC");
            PSEnum.Gray = cTID("Gry ");
            PSEnum.Merged = cTID("Mrgd");
            PSEnum.None = cTID("None");
            PSEnum.Normal = cTID("Nrml");
            PSEnum.RGB = cTID("RGB ");
            PSEnum.RevealAll = cTID("RvlA");
            PSEnum.Subtract = cTID("Sbtr");
            PSEnum.Target = cTID("Trgt");
            PSEnum.Transparency = cTID("Trsp");
            PSEvent.Delete = cTID("Dlt ");
            PSEvent.Fill = cTID("Fl  ");
            PSEvent.Hide = cTID("Hd  ");
            PSEvent.Make = cTID("Mk  ");
            PSEvent.Median = cTID("Mdn ");
            PSEvent.Select = cTID("slct");
            PSEvent.Set = cTID("setd");
            PSEvent.Show = cTID("Shw ");
            PSKey.Adjustment = cTID("Adjs");
            PSKey.At = cTID("At  ");
            PSKey.Blue = cTID("Bl  ");
            PSKey.Curve = cTID("Crv ");
            PSKey.From = cTID("From");
            PSKey.Green = cTID("Grn ");
            PSKey.Horizontal = cTID("Hrzn");
            PSKey.MakeVisible = cTID("MkVs");
            PSKey.Mode = cTID("Md  ");
            PSKey.Name = cTID("Nm  ");
            PSKey.New = cTID("Nw  ");
            PSKey.Offset = cTID("Ofst");
            PSKey.Opacity = cTID("Opct");
            PSKey.Radius = cTID("Rds ");
            PSKey.Red = cTID("Rd  ");
            PSKey.Scale = cTID("Scl ");
            PSKey.Source = cTID("Srce");
            PSKey.To = cTID("T   ");
            PSKey.Type = cTID("Type");
            PSKey.Using = cTID("Usng");
            PSKey.Vertical = cTID("Vrtc");
            PSKey.With = cTID("With");
            PSString.Null = sTID("null");
            PSString.addToSelectionContinuous = sTID("addToSelectionContinuous");
            PSString.layerGroup = sTID("layerSection");
            PSString.linearLight = sTID("linearLight");
            PSString.presetKind = sTID("presetKind");
            PSString.presetKindCustom = sTID("presetKindCustom");
            PSString.presetKindDefault = sTID("presetKindDefault");
            PSString.presetKindType = sTID("presetKindType");
            PSString.selection = sTID("selection");
            PSString.selectionModifier = sTID("selectionModifier");
            PSString.selectionModifierType = sTID("selectionModifierType");
            PSType.BlendMode = cTID("BlnM");
            PSType.Calculation = cTID("Clcn");
            PSType.FillContents = cTID("FlCn");
            PSType.Ordinal = cTID("Ordn");
            PSType.UserMaskOptions = cTID("UsrM");
            PSUnit.Percent = cTID("#Prc");
            PSUnit.Pixels = cTID("#Pxl");
        };
        A2FSSimpleMedian16.loadSymbols();
        A2FSSimpleMedian16.main = function() {
            A2FSSimpleMedian16();
        };
        A2FSSimpleMedian16.main();
    }

    function FS_TWOFS16() {
        function A2FSManualMedian16() {
            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);
                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.putEnumerated(PSKey.Using, PSType.FillContents, PSEnum.Gray);
                desc1.putUnitDouble(PSKey.Opacity, PSUnit.Percent, 100);
                desc1.putEnumerated(PSKey.Mode, PSType.BlendMode, PSEnum.Normal);
                executeAction(PSEvent.Fill, 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.putProperty(PSClass.Channel, PSString.selection);
                desc1.putReference(PSString.Null, ref1);
                desc1.putEnumerated(PSKey.To, PSType.Ordinal, PSEnum.None);
                executeAction(PSEvent.Set, desc1, dialogMode);
            }

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

            function step5(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 step6(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 step7(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.putEnumerated(PSClass.Layer, PSType.Ordinal, PSEnum.Merged);
                desc2.putReference(PSKey.To, ref1);
                desc1.putObject(PSKey.With, PSClass.Calculation, desc2);
                executeAction(sTID("applyImageEvent"), desc1, 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, "Temp_1");
                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;
                executeAction(sTID("copyToLayer"), undefined, 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.Layer, PSType.Ordinal, PSEnum.Target);
                desc1.putReference(PSString.Null, ref1);
                var desc2 = new ActionDescriptor();
                desc2.putString(PSKey.Name, "Temp_2");
                desc1.putObject(PSKey.To, PSClass.Layer, desc2);
                executeAction(PSEvent.Set, desc1, dialogMode);
            }

            function step11(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 step12(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_1");
                desc1.putReference(PSString.Null, ref1);
                desc1.putBoolean(PSKey.MakeVisible, false);
                executeAction(PSEvent.Select, desc1, dialogMode);
            }

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

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

            function step15(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_Selection");
                desc1.putReference(PSString.Null, ref1);
                desc1.putBoolean(PSKey.MakeVisible, false);
                executeAction(PSEvent.Select, desc1, 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.putProperty(PSClass.Channel, PSString.selection);
                desc1.putReference(PSString.Null, ref1);
                var ref2 = new ActionReference();
                ref2.putEnumerated(PSClass.Channel, PSClass.Channel, PSEnum.Transparency);
                desc1.putReference(PSKey.To, ref2);
                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 ref1 = new ActionReference();
                ref1.putEnumerated(PSClass.Layer, PSType.Ordinal, PSEnum.Target);
                desc1.putReference(PSString.Null, ref1);
                executeAction(PSEvent.Delete, 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, "Low");
                desc1.putReference(PSString.Null, ref1);
                desc1.putBoolean(PSKey.MakeVisible, false);
                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();
                var ref1 = new ActionReference();
                ref1.putEnumerated(PSClass.Channel, PSClass.Channel, PSClass.Mask);
                desc1.putReference(PSString.Null, ref1);
                desc1.putBoolean(PSKey.MakeVisible, false);
                executeAction(PSEvent.Select, 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.putProperty(PSClass.Color, PSEnum.ForegroundColor);
                desc1.putReference(PSString.Null, ref1);
                var desc2 = new ActionDescriptor();
                desc2.putDouble(PSKey.Red, 127.996108949416);
                desc2.putDouble(PSKey.Green, 127.996108949416);
                desc2.putDouble(PSKey.Blue, 127.996108949416);
                desc1.putObject(PSKey.To, PSClass.RGBColor, desc2);
                desc1.putString(PSKey.Source, "photoshopPicker");
                executeAction(PSEvent.Set, desc1, dialogMode);
            }

            function step21(enabled, withDialog) {
                if (enabled != undefined && !enabled) {
                    return;
                }
                var dialogMode = withDialog ? DialogModes.ALL : DialogModes.NO;
                var desc1 = new ActionDescriptor();
                desc1.putEnumerated(PSKey.Using, PSType.FillContents, PSEnum.Gray);
                desc1.putUnitDouble(PSKey.Opacity, PSUnit.Percent, 100);
                desc1.putEnumerated(PSKey.Mode, PSType.BlendMode, PSEnum.Normal);
                executeAction(PSEvent.Fill, 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.putClass(PSClass.AdjustmentLayer);
                desc1.putReference(PSString.Null, ref1);
                var desc2 = new ActionDescriptor();
                desc2.putClass(PSKey.Type, PSClass.Invert);
                desc1.putObject(PSKey.Using, PSClass.AdjustmentLayer, desc2);
                executeAction(PSEvent.Make, desc1, dialogMode);
            }

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

            function step24(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_Invert");
                desc1.putObject(PSKey.To, PSClass.Layer, desc2);
                executeAction(PSEvent.Set, 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.Layer, PSType.Ordinal, PSEnum.Target);
                desc1.putReference(PSString.Null, ref1);
                executeAction(sTID("groupEvent"), 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.putName(PSClass.Layer, "Low");
                desc1.putReference(PSString.Null, ref1);
                desc1.putBoolean(PSKey.MakeVisible, false);
                executeAction(PSEvent.Select, desc1, dialogMode);
            }

            function step27(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(PSEvent.Median, 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.putEnumerated(PSClass.Layer, PSType.Ordinal, PSEnum.Target);
                desc1.putReference(PSString.Null, ref1);
                var desc2 = new ActionDescriptor();
                desc2.putString(PSKey.Name, "Temp_1");
                desc1.putObject(PSKey.To, PSClass.Layer, desc2);
                executeAction(PSEvent.Set, 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.putEnumerated(PSClass.Channel, PSClass.Channel, PSClass.Mask);
                desc1.putReference(PSString.Null, ref1);
                desc1.putBoolean(PSKey.MakeVisible, false);
                executeAction(PSEvent.Select, 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.Channel, PSType.Ordinal, PSEnum.Target);
                desc1.putReference(PSString.Null, ref1);
                executeAction(PSEvent.Delete, 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.putName(PSClass.Layer, "Temp_Invert");
                desc1.putReference(PSString.Null, ref1);
                desc1.putBoolean(PSKey.MakeVisible, false);
                executeAction(PSEvent.Select, 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);
                executeAction(PSEvent.Delete, 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_2");
                desc1.putReference(PSString.Null, ref1);
                desc1.putBoolean(PSKey.MakeVisible, false);
                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();
                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 step35(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_1");
                desc2.putReference(PSKey.To, ref1);
                desc2.putBoolean(PSClass.Invert, true);
                desc2.putEnumerated(PSClass.Calculation, PSType.Calculation, PSEnum.Add);
                desc2.putDouble(PSKey.Scale, 2);
                desc2.putInteger(PSKey.Offset, 0);
                desc1.putObject(PSKey.With, PSClass.Calculation, desc2);
                executeAction(sTID("applyImageEvent"), desc1, dialogMode);
            }

            function step36(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 step37(enabled, withDialog) {
                if (enabled != undefined && !enabled) {
                    return;
                }
                var dialogMode = withDialog ? DialogModes.ALL : DialogModes.NO;
                executeAction(sTID("copyToLayer"), undefined, 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.putEnumerated(PSClass.Layer, PSType.Ordinal, PSEnum.Target);
                desc1.putReference(PSString.Null, ref1);
                executeAction(sTID("groupEvent"), desc1, dialogMode);
            }

            function step39(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_Retouch");
                desc1.putObject(PSKey.To, PSClass.Layer, desc2);
                executeAction(PSEvent.Set, desc1, 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.putEnumerated(PSClass.Layer, PSType.Ordinal, PSEnum.Target);
                desc1.putReference(PSString.Null, ref1);
                var desc2 = new ActionDescriptor();
                desc2.putEnumerated(PSKey.Mode, PSType.BlendMode, PSEnum.Normal);
                desc1.putObject(PSKey.To, PSClass.Layer, desc2);
                executeAction(PSEvent.Set, 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.AdjustmentLayer);
                desc1.putReference(PSString.Null, ref1);
                var desc2 = new ActionDescriptor();
                var desc3 = new ActionDescriptor();
                desc3.putEnumerated(PSString.presetKind, PSString.presetKindType, PSString.presetKindDefault);
                desc2.putObject(PSKey.Type, PSClass.Curves, desc3);
                desc1.putObject(PSKey.Using, PSClass.AdjustmentLayer, desc2);
                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 ref1 = new ActionReference();
                ref1.putEnumerated(PSClass.Channel, PSType.Ordinal, PSEnum.Target);
                desc1.putReference(PSString.Null, ref1);
                executeAction(PSEvent.Delete, 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, "Texture_Boost");
                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;
                var desc1 = new ActionDescriptor();
                var ref1 = new ActionReference();
                ref1.putEnumerated(PSClass.AdjustmentLayer, PSType.Ordinal, PSEnum.Target);
                desc1.putReference(PSString.Null, ref1);
                var desc2 = new ActionDescriptor();
                desc2.putEnumerated(PSString.presetKind, PSString.presetKindType, PSString.presetKindCustom);
                var list1 = new ActionList();
                var desc3 = new ActionDescriptor();
                var ref2 = new ActionReference();
                ref2.putEnumerated(PSClass.Channel, PSClass.Channel, PSEnum.Composite);
                desc3.putReference(PSClass.Channel, ref2);
                var list2 = new ActionList();
                var desc4 = new ActionDescriptor();
                desc4.putDouble(PSKey.Horizontal, 72);
                desc4.putDouble(PSKey.Vertical, 0);
                list2.putObject(PSClass.Point, desc4);
                var desc5 = new ActionDescriptor();
                desc5.putDouble(PSKey.Horizontal, 128);
                desc5.putDouble(PSKey.Vertical, 128);
                list2.putObject(PSClass.Point, desc5);
                var desc6 = new ActionDescriptor();
                desc6.putDouble(PSKey.Horizontal, 181);
                desc6.putDouble(PSKey.Vertical, 255);
                list2.putObject(PSClass.Point, desc6);
                desc3.putList(PSKey.Curve, list2);
                list1.putObject(PSClass.CurvesAdjustment, desc3);
                desc2.putList(PSKey.Adjustment, list1);
                desc1.putObject(PSKey.To, PSClass.Curves, desc2);
                executeAction(PSEvent.Set, desc1, dialogMode);
            }

            function step45(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.AdjustmentLayer, PSType.Ordinal, PSEnum.Target);
                desc1.putReference(PSString.Null, ref1);
                var desc2 = new ActionDescriptor();
                var list1 = new ActionList();
                var desc3 = new ActionDescriptor();
                var ref2 = new ActionReference();
                ref2.putEnumerated(PSClass.Channel, PSClass.Channel, PSEnum.Composite);
                desc3.putReference(PSClass.Channel, ref2);
                var list2 = new ActionList();
                var desc4 = new ActionDescriptor();
                desc4.putDouble(PSKey.Horizontal, 113);
                desc4.putDouble(PSKey.Vertical, 0);
                list2.putObject(PSClass.Point, desc4);
                var desc5 = new ActionDescriptor();
                desc5.putDouble(PSKey.Horizontal, 128);
                desc5.putDouble(PSKey.Vertical, 128);
                list2.putObject(PSClass.Point, desc5);
                var desc6 = new ActionDescriptor();
                desc6.putDouble(PSKey.Horizontal, 148);
                desc6.putDouble(PSKey.Vertical, 255);
                list2.putObject(PSClass.Point, desc6);
                desc3.putList(PSKey.Curve, list2);
                list1.putObject(PSClass.CurvesAdjustment, desc3);
                desc2.putList(PSKey.Adjustment, list1);
                desc1.putObject(PSKey.To, PSClass.Curves, desc2);
                executeAction(PSEvent.Set, desc1, dialogMode);
            }

            function step46(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 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.Layer, PSType.Ordinal, PSEnum.Target);
                desc1.putReference(PSString.Null, ref1);
                executeAction(sTID("groupEvent"), 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.putName(PSClass.Layer, "Temp_1");
                desc1.putReference(PSString.Null, ref1);
                desc1.putEnumerated(PSString.selectionModifier, PSString.selectionModifierType, PSString.addToSelectionContinuous);
                desc1.putBoolean(PSKey.MakeVisible, false);
                executeAction(PSEvent.Select, desc1, dialogMode);
            }

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

            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.putEnumerated(PSClass.Layer, PSType.Ordinal, PSEnum.Target);
                desc1.putReference(PSString.Null, ref1);
                var desc2 = new ActionDescriptor();
                desc2.putEnumerated(PSClass.Color, PSClass.Color, PSKey.Blue);
                desc1.putObject(PSKey.To, PSClass.Layer, desc2);
                executeAction(PSEvent.Set, 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 desc2 = new ActionDescriptor();
                desc2.putString(PSKey.Name, "FS_Radius_");
                desc1.putObject(PSKey.To, PSClass.Layer, desc2);
                executeAction(PSEvent.Set, desc1, dialogMode);
            }

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

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

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

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

function bits() {
        var bit = 8;
        if (app.activeDocument.bitsPerChannel == BitsPerChannelType.EIGHT) {
            bit = 8
        }
        if (app.activeDocument.bitsPerChannel == BitsPerChannelType.SIXTEEN) {
            bit = 16
        }
        return bit;
    }

    function bounds() {
        var detect1 = true;
        try {
            var detect2 = app.activeDocument.selection.bounds;
        } catch (a) {
            detect1 = false;
        }
        return detect1;
    }
    

3.作者寄语

  合理的脚本代码可以有效的提高工作效率,减少重复劳动。


  欢迎光临知了软件开发网络平台,本公司定制开发各类软件,主要方向为桌面专业软件开发、插件定制开发、微信小程序(各类小程序)、网站定制开发和App开发,桌面软件主要包括文字图形识别类软件,信息管理类软件,3D打印类软件,视频类软件以及其它涉及专业的各类图形图像处理软件。插件包含AE插件,AI插件,PS插件,PDF插件,3DMAX插件以及Word,Excel等Office插件开发。详情请咨询,微信QQ:312117271,手机:18928899728,邮箱: anjingzhi_sea@163.com.
公司网址:http://www.zhiliaos.com

上一篇:视觉AI训练营-Day 3


下一篇:【踩坑实录】