Photoshop插件--去除瑕疵--眼睛工具--脚本开发--PS插件

文章目录


  PS是一款栅格图像编辑软件,具有许多强大的功能,本文演示如何通过脚本实现去除瑕疵和眼睛工具相关功能,展示从互联网收集而来的一个小插件,供大家学习交流,请勿用于商业用途。

1.插件界面

  本文界面是一系列功能的一部分,将逐步展示,但是功能界面是共同的,如下图所示:
Photoshop插件--去除瑕疵--眼睛工具--脚本开发--PS插件

2.关键代码

2.1 去除瑕疵

  大家可通过源代码阅读,来掌握相关技巧,源代码如下:

//
// Generated Tue Feb 17 2015 14:49:13 GMT+0600
//

//
//==================== Remove Pores ==============
//
function RemovePores() {
    // Make
    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);
    };

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

    // Dust & Scratches
    function step3(enabled, withDialog) {
        if (enabled != undefined && !enabled)
            return;
        var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
        var desc1 = new ActionDescriptor();
        desc1.putInteger(PSKey.Radius, 3);
        desc1.putInteger(PSKey.Threshold, 15);
        executeAction(sTID('dustAndScratches'), desc1, dialogMode);
    };

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

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

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

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

    // Select
    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.putClass(PSClass.PaintbrushTool);
        desc1.putReference(PSString.Null, ref1);
        executeAction(PSEvent.Select, desc1, dialogMode);
    };

    // Set
    function step9(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.Color, PSKey.Color, PSEnum.Blue);
        desc1.putObject(PSKey.To, PSClass.Layer, desc2);
        executeAction(PSEvent.Set, desc1, dialogMode);
    };

    step1();      // Make
    step2();      // Merge Visible
    step3(true, true);      // Dust & Scratches
    step4();      // Make
    step5();      // Select
    step6();      // Set
    step7();      // Select
    step8();      // Select
    step9();      // Set
};


cTID = function (s) {
    return app.charIDToTypeID(s);
};
sTID = function (s) {
    return app.stringIDToTypeID(s);
};

//
// RemovePores.loadSymbols
//   Loading up the symbol definitions like this makes it possible
//   to include several of these generated files in one master file
//   provided a prefix is specified other than the default. It also
//   skips the definitions if PSConstants has already been loaded.
//
RemovePores.loadSymbols = function () {
    var dbgLevel = $.level;
    $.level = 0;
    try {
        PSConstants;
        return; // only if PSConstants is defined
    } 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 () {
        };
    }

    // We may still end up duplicating some of the following definitions
    // but at least we don't redefine PSClass, etc... and wipe out others
    PSClass.AdjustmentLayer = cTID('AdjL');
    PSClass.Channel = cTID('Chnl');
    PSClass.ChannelMatrix = cTID('ChMx');
    PSClass.ChannelMixer = cTID('ChnM');
    PSClass.Curves = cTID('Crvs');
    PSClass.CurvesAdjustment = cTID('CrvA');
    PSClass.Layer = cTID('Lyr ');
    PSClass.Mask = cTID('Msk ');
    PSClass.PaintbrushTool = cTID('PbTl');
    PSClass.Point = cTID('Pnt ');
    PSEnum.Best = cTID('Bst ');
    PSEnum.Blue = cTID('Bl  ');
    PSEnum.Composite = cTID('Cmps');
    PSEnum.HideAll = cTID('HdAl');
    PSEnum.Luminosity = cTID('Lmns');
    PSEnum.Midtones = cTID('Mdtn');
    PSEnum.None = cTID('None');
    PSEnum.RGB = cTID('RGB ');
    PSEnum.Target = cTID('Trgt');
    PSEnum.Zoom = cTID('Zm  ');
    PSEvent.Delete = cTID('Dlt ');
    PSEvent.Hide = cTID('Hd  ');
    PSEvent.Make = cTID('Mk  ');
    PSEvent.Select = cTID('slct');
    PSEvent.Set = cTID('setd');
    PSEvent.Show = cTID('Shw ');
    PSKey.Adjustment = cTID('Adjs');
    PSKey.Amount = cTID('Amnt');
    PSKey.At = cTID('At  ');
    PSKey.BlurMethod = cTID('BlrM');
    PSKey.BlurQuality = cTID('BlrQ');
    PSKey.Color = cTID('Clr ');
    PSKey.Colors = cTID('Clrs');
    PSKey.Constrain = cTID('Cnst');
    PSKey.Curve = cTID('Crv ');
    PSKey.Duplicate = cTID('Dplc');
    PSKey.From = cTID('From');
    PSKey.Gray = cTID('Gry ');
    PSKey.Green = cTID('Grn ');
    PSKey.Horizontal = cTID('Hrzn');
    PSKey.MakeVisible = cTID('MkVs');
    PSKey.Mode = cTID('Md  ');
    PSKey.Monochromatic = cTID('Mnch');
    PSKey.Name = cTID('Nm  ');
    PSKey.New = cTID('Nw  ');
    PSKey.Opacity = cTID('Opct');
    PSKey.Radius = cTID('Rds ');
    PSKey.Red = cTID('Rd  ');
    PSKey.Threshold = cTID('Thsh');
    PSKey.To = cTID('T   ');
    PSKey.Type = cTID('Type');
    PSKey.Using = cTID('Usng');
    PSKey.Vertical = cTID('Vrtc');
    PSString.Null = sTID('null');
    PSString.addToSelectionContinuous = sTID('addToSelectionContinuous');
    PSString.layerGroup = sTID('layerSection');
    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.Ordinal = cTID('Ordn');
    PSType.UserMaskOptions = cTID('UsrM');
    PSUnit.Percent = cTID('#Prc');
    PSUnit.Pixels = cTID('#Pxl');
};

RemovePores.loadSymbols(); // load up our symbols


//=========================================
//                    RemovePores.main
//=========================================
//

RemovePores.main = function () {
    RemovePores();
};

RemovePores.main();

// EOF

2.2 眼睛工具

  大家可通过源代码阅读,来掌握相关技巧,源代码如下:

//
// Generated Wed Feb 18 2015 20:53:38 GMT+0600
//

//
//==================== Eyes Tool ==============
//
function EyesTool() {
    // Make
    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(PSString.layerGroup);
        desc1.putReference(PSString.Null, ref1);
        var desc2 = new ActionDescriptor();
        desc2.putString(PSKey.Name, "Eyes_Tool");
        desc2.putEnumerated(PSKey.Color, PSKey.Color, PSEnum.Blue);
        desc1.putObject(PSKey.Using, PSString.layerGroup, desc2);
        executeAction(PSEvent.Make, desc1, dialogMode);
    };

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

    // Set
    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.putEnumerated(PSKey.Color, PSKey.Color, PSEnum.Blue);
        desc1.putObject(PSKey.To, PSClass.Layer, desc2);
        executeAction(PSEvent.Set, desc1, dialogMode);
    };

    // Make
    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.putClass(PSClass.Layer);
        desc1.putReference(PSString.Null, ref1);
        executeAction(PSEvent.Make, desc1, dialogMode);
    };

    // Apply Image
    function step5(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);
    };

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

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

    // High Pass
    function step8(enabled, withDialog) {
        if (enabled != undefined && !enabled)
            return;
        var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
        var desc1 = new ActionDescriptor();
        desc1.putUnitDouble(PSKey.Radius, PSUnit.Pixels, 10);
        executeAction(sTID('highPass'), desc1, dialogMode);
    };

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

    // Make
    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.putClass(PSClass.AdjustmentLayer);
        desc1.putReference(PSString.Null, ref1);
        var desc2 = new ActionDescriptor();
        desc2.putEnumerated(PSKey.Color, PSKey.Color, PSEnum.Blue);
        var desc3 = new ActionDescriptor();
        desc3.putEnumerated(PSString.presetKind, PSString.presetKindType, PSString.presetKindDefault);
        desc3.putBoolean(PSKey.Colorize, false);
        desc2.putObject(PSKey.Type, PSClass.HueSaturation, desc3);
        desc1.putObject(PSKey.Using, PSClass.AdjustmentLayer, desc2);
        executeAction(PSEvent.Make, desc1, dialogMode);
    };

    // Select
    function step11(enabled, withDialog) {
        if (enabled != undefined && !enabled)
            return;
        var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
        var desc1 = new ActionDescriptor();
        var ref1 = new ActionReference();
        ref1.putEnumerated(PSClass.Channel, PSClass.Channel, PSEnum.RGB);
        desc1.putReference(PSString.Null, ref1);
        desc1.putBoolean(PSKey.MakeVisible, false);
        executeAction(PSEvent.Select, desc1, dialogMode);
    };

    // Select
    function step12(enabled, withDialog) {
        if (enabled != undefined && !enabled)
            return;
        var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
        var desc1 = new ActionDescriptor();
        var ref1 = new ActionReference();
        ref1.putEnumerated(PSClass.Channel, PSClass.Channel, PSClass.Mask);
        desc1.putReference(PSString.Null, ref1);
        desc1.putBoolean(PSKey.MakeVisible, false);
        executeAction(PSEvent.Select, desc1, dialogMode);
    };

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

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

    // Set
    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.putEnumerated(PSClass.AdjustmentLayer, PSType.Ordinal, PSEnum.Target);
        desc1.putReference(PSString.Null, ref1);
        var desc2 = new ActionDescriptor();
        var list1 = new ActionList();
        var desc3 = new ActionDescriptor();
        desc3.putInteger(PSKey.LocalRange, 1);
        desc3.putInteger(PSKey.BeginRamp, 315);
        desc3.putInteger(PSKey.BeginSustain, 345);
        desc3.putInteger(PSKey.EndSustain, 15);
        desc3.putInteger(PSKey.EndRamp, 45);
        desc3.putInteger(PSKey.Hue, 0);
        desc3.putInteger(PSKey.Start, -65);
        desc3.putInteger(PSKey.Lightness, 0);
        list1.putObject(PSClass.HueSatAdjustmentV2, desc3);
        var desc4 = new ActionDescriptor();
        desc4.putInteger(PSKey.LocalRange, 6);
        desc4.putInteger(PSKey.BeginRamp, 255);
        desc4.putInteger(PSKey.BeginSustain, 285);
        desc4.putInteger(PSKey.EndSustain, 315);
        desc4.putInteger(PSKey.EndRamp, 345);
        desc4.putInteger(PSKey.Hue, 0);
        desc4.putInteger(PSKey.Start, -65);
        desc4.putInteger(PSKey.Lightness, 0);
        list1.putObject(PSClass.HueSatAdjustmentV2, desc4);
        desc2.putList(PSKey.Adjustment, list1);
        desc1.putObject(PSKey.To, PSClass.HueSaturation, desc2);
        executeAction(PSEvent.Set, desc1, dialogMode);
    };

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

    // Make
    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.putClass(PSClass.AdjustmentLayer);
        desc1.putReference(PSString.Null, ref1);
        var desc2 = new ActionDescriptor();
        desc2.putEnumerated(PSKey.Color, PSKey.Color, PSEnum.Blue);
        var desc3 = new ActionDescriptor();
        desc3.putEnumerated(PSString.presetKind, PSString.presetKindType, PSString.presetKindDefault);
        desc3.putBoolean(PSKey.Colorize, false);
        desc2.putObject(PSKey.Type, PSClass.HueSaturation, desc3);
        desc1.putObject(PSKey.Using, PSClass.AdjustmentLayer, desc2);
        executeAction(PSEvent.Make, desc1, dialogMode);
    };

    // Set
    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.AdjustmentLayer, PSType.Ordinal, PSEnum.Target);
        desc1.putReference(PSString.Null, ref1);
        var desc2 = new ActionDescriptor();
        var list1 = new ActionList();
        var desc3 = new ActionDescriptor();
        desc3.putInteger(PSKey.LocalRange, 4);
        desc3.putInteger(PSKey.BeginRamp, 135);
        desc3.putInteger(PSKey.BeginSustain, 165);
        desc3.putInteger(PSKey.EndSustain, 195);
        desc3.putInteger(PSKey.EndRamp, 225);
        desc3.putInteger(PSKey.Hue, 0);
        desc3.putInteger(PSKey.Start, -65);
        desc3.putInteger(PSKey.Lightness, 0);
        list1.putObject(PSClass.HueSatAdjustmentV2, desc3);
        var desc4 = new ActionDescriptor();
        desc4.putInteger(PSKey.LocalRange, 5);
        desc4.putInteger(PSKey.BeginRamp, 195);
        desc4.putInteger(PSKey.BeginSustain, 225);
        desc4.putInteger(PSKey.EndSustain, 255);
        desc4.putInteger(PSKey.EndRamp, 285);
        desc4.putInteger(PSKey.Hue, 0);
        desc4.putInteger(PSKey.Start, -65);
        desc4.putInteger(PSKey.Lightness, 0);
        list1.putObject(PSClass.HueSatAdjustmentV2, desc4);
        desc2.putList(PSKey.Adjustment, list1);
        desc1.putObject(PSKey.To, PSClass.HueSaturation, desc2);
        executeAction(PSEvent.Set, desc1, dialogMode);
    };

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

    // Select
    function step20(enabled, withDialog) {
        if (enabled != undefined && !enabled)
            return;
        var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
        var desc1 = new ActionDescriptor();
        var ref1 = new ActionReference();
        ref1.putEnumerated(PSClass.Channel, PSClass.Channel, PSEnum.RGB);
        desc1.putReference(PSString.Null, ref1);
        desc1.putBoolean(PSKey.MakeVisible, false);
        executeAction(PSEvent.Select, desc1, dialogMode);
    };

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

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

    // Make
    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.putClass(PSClass.AdjustmentLayer);
        desc1.putReference(PSString.Null, ref1);
        var desc2 = new ActionDescriptor();
        var desc3 = new ActionDescriptor();
        desc3.putEnumerated(PSString.presetKind, PSString.presetKindType, PSString.presetKindDefault);
        desc3.putBoolean(PSKey.Colorize, false);
        desc2.putObject(PSKey.Type, PSClass.HueSaturation, desc3);
        desc1.putObject(PSKey.Using, PSClass.AdjustmentLayer, desc2);
        executeAction(PSEvent.Make, desc1, dialogMode);
    };

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

    // Set
    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);
        var desc2 = new ActionDescriptor();
        desc2.putString(PSKey.Name, "Iris_Color");
        desc1.putObject(PSKey.To, PSClass.Layer, desc2);
        executeAction(PSEvent.Set, desc1, dialogMode);
    };

    // Set
    function step26(enabled, withDialog) {
        if (enabled != undefined && !enabled)
            return;
        var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
        var desc1 = new ActionDescriptor();
        var ref1 = new ActionReference();
        ref1.putEnumerated(PSClass.Layer, PSType.Ordinal, PSEnum.Target);
        desc1.putReference(PSString.Null, ref1);
        var desc2 = new ActionDescriptor();
        desc2.putUnitDouble(PSKey.Opacity, PSUnit.Percent, 30);
        desc1.putObject(PSKey.To, PSClass.Layer, desc2);
        executeAction(PSEvent.Set, desc1, dialogMode);
    };

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

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

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

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

    // Set
    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.AdjustmentLayer, PSType.Ordinal, PSEnum.Target);
        desc1.putReference(PSString.Null, ref1);
        var desc2 = new ActionDescriptor();
        desc2.putBoolean(PSKey.Colorize, true);
        var list1 = new ActionList();
        var desc3 = new ActionDescriptor();
        desc3.putEnumerated(PSClass.Channel, PSClass.Channel, PSEnum.Composite);
        desc3.putInteger(PSKey.Hue, 215);
        desc3.putInteger(PSKey.Start, 25);
        desc3.putInteger(PSKey.Lightness, 0);
        list1.putObject(PSClass.HueSatAdjustmentV2, desc3);
        desc2.putList(PSKey.Adjustment, list1);
        desc1.putObject(PSKey.To, PSClass.HueSaturation, desc2);
        executeAction(PSEvent.Set, desc1, dialogMode);
    };

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

    // Make
    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.putClass(PSString.contentLayer);
        desc1.putReference(PSString.Null, ref1);
        var desc2 = new ActionDescriptor();
        var desc3 = new ActionDescriptor();
        var desc4 = new ActionDescriptor();
        desc4.putDouble(PSKey.Red, 255);
        desc4.putDouble(PSKey.Green, 255);
        desc4.putDouble(PSEnum.Blue, 255);
        desc3.putObject(PSKey.Color, PSClass.RGBColor, desc4);
        desc2.putObject(PSKey.Type, PSString.solidColorLayer, desc3);
        desc1.putObject(PSKey.Using, PSString.contentLayer, desc2);
        executeAction(PSEvent.Make, desc1, dialogMode);
    };

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

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

    // Set
    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, PSEnum.Overlay);
        desc1.putObject(PSKey.To, PSClass.Layer, desc2);
        executeAction(PSEvent.Set, desc1, dialogMode);
    };

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

    // Layer Via Copy
    function step38(enabled, withDialog) {
        if (enabled != undefined && !enabled)
            return;
        var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
        executeAction(sTID('copyToLayer'), undefined, dialogMode);
    };

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

    // Select
    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.putClass(PSClass.PaintbrushTool);
        desc1.putReference(PSString.Null, ref1);
        executeAction(PSEvent.Select, desc1, dialogMode);
    };

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

    // Select
    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.putName(PSClass.Layer, "Iris_Color");
        desc1.putReference(PSString.Null, ref1);
        desc1.putEnumerated(PSString.selectionModifier, PSString.selectionModifierType, PSString.addToSelectionContinuous);
        desc1.putBoolean(PSKey.MakeVisible, false);
        executeAction(PSEvent.Select, desc1, dialogMode);
    };

    // Select
    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.putName(PSClass.Layer, "Iris_Color");
        desc1.putReference(PSString.Null, ref1);
        desc1.putBoolean(PSKey.MakeVisible, false);
        executeAction(PSEvent.Select, desc1, dialogMode);
    };

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

    // Select
    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.putName(PSClass.Layer, "Eyes_Tool");
        desc1.putReference(PSString.Null, ref1);
        desc1.putBoolean(PSKey.MakeVisible, false);
        executeAction(PSEvent.Select, desc1, dialogMode);
    };

    // Select
    function step46(enabled, withDialog) {
        if (enabled != undefined && !enabled)
            return;
        var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
        var desc1 = new ActionDescriptor();
        var ref1 = new ActionReference();
        ref1.putName(PSClass.Layer, "Bright_Iris");
        desc1.putReference(PSString.Null, ref1);
        desc1.putBoolean(PSKey.MakeVisible, false);
        executeAction(PSEvent.Select, desc1, dialogMode);
    };

    // Select
    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.putName(PSClass.Layer, "Bright_Eye_Ball");
        desc1.putReference(PSString.Null, ref1);
        desc1.putBoolean(PSKey.MakeVisible, false);
        executeAction(PSEvent.Select, desc1, dialogMode);
    };

    // Set
    function step48(enabled, withDialog) {
        if (enabled != undefined && !enabled)
            return;
        var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
        var desc1 = new ActionDescriptor();
        var ref1 = new ActionReference();
        ref1.putEnumerated(PSClass.Layer, PSType.Ordinal, PSEnum.Target);
        desc1.putReference(PSString.Null, ref1);
        var desc2 = new ActionDescriptor();
        desc2.putUnitDouble(PSKey.Opacity, PSUnit.Percent, 40);
        desc1.putObject(PSKey.To, PSClass.Layer, desc2);
        executeAction(PSEvent.Set, desc1, dialogMode);
    };

    // Make
    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(PSClass.Layer);
        desc1.putReference(PSString.Null, ref1);
        var desc2 = new ActionDescriptor();
        desc2.putString(PSKey.Name, "D&B_Eyes");
        desc2.putEnumerated(PSKey.Mode, PSType.BlendMode, PSEnum.Overlay);
        desc2.putBoolean(PSKey.FillNeutral, true);
        desc1.putObject(PSKey.Using, PSClass.Layer, desc2);
        executeAction(PSEvent.Make, desc1, dialogMode);
    };

    // Make
    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.putClass(PSClass.Layer);
        desc1.putReference(PSString.Null, ref1);
        var desc2 = new ActionDescriptor();
        desc2.putString(PSKey.Name, "D&B_Eyelid");
        desc2.putEnumerated(PSKey.Mode, PSType.BlendMode, PSEnum.SoftLight);
        desc2.putBoolean(PSKey.FillNeutral, true);
        desc1.putObject(PSKey.Using, PSClass.Layer, desc2);
        executeAction(PSEvent.Make, desc1, dialogMode);
    };

    // Make
    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.putClass(PSClass.AdjustmentLayer);
        desc1.putReference(PSString.Null, ref1);
        var desc2 = new ActionDescriptor();
        desc2.putEnumerated(PSKey.Color, PSKey.Color, PSEnum.Blue);
        var desc3 = new ActionDescriptor();
        desc3.putEnumerated(PSString.presetKind, PSString.presetKindType, PSString.presetKindDefault);
        desc3.putBoolean(PSKey.Colorize, false);
        desc2.putObject(PSKey.Type, PSClass.HueSaturation, desc3);
        desc1.putObject(PSKey.Using, PSClass.AdjustmentLayer, desc2);
        executeAction(PSEvent.Make, desc1, dialogMode);
    };

    // Set
    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.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();
        desc3.putInteger(PSKey.Hue, -50);
        desc3.putInteger(PSKey.Start, -10);
        desc3.putInteger(PSKey.Lightness, 0);
        list1.putObject(PSClass.HueSatAdjustmentV2, desc3);
        desc2.putList(PSKey.Adjustment, list1);
        desc1.putObject(PSKey.To, PSClass.HueSaturation, desc2);
        executeAction(PSEvent.Set, desc1, dialogMode);
    };

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

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

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

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

    // Layer Via Copy
    function step57(enabled, withDialog) {
        if (enabled != undefined && !enabled)
            return;
        var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
        executeAction(sTID('copyToLayer'), undefined, dialogMode);
    };

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

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

    // Select
    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.Channel, PSClass.Channel, PSClass.Mask);
        ref1.putName(PSClass.Layer, "Iris_Boost");
        desc1.putReference(PSString.Null, ref1);
        desc1.putBoolean(PSKey.MakeVisible, false);
        executeAction(PSEvent.Select, desc1, dialogMode);
    };

    // Select
    function step61(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.PaintbrushTool);
        desc1.putReference(PSString.Null, ref1);
        executeAction(PSEvent.Select, desc1, dialogMode);
    };

    step1();      // Make
    step2();      // Set
    step3();      // Set
    step4();      // Make
    step5();      // Apply Image
    step6();      // Set
    step7();      // Set
    step8(true, true);      // High Pass
    step9();      // Make
    step10();      // Make
    step11();      // Select
    step12();      // Select
    step13();      // Invert
    step14();      // Select
    step15();      // Set
    step16();      // Set
    step17();      // Make
    step18();      // Set
    step19();      // Invert
    step20();      // Select
    step21();      // Set
    step22();      // Select
    step23();      // Make
    step24();      // Select
    step25();      // Set
    step26();      // Set
    step27();      // Set
    step28();      // Select
    step29();      // Invert
    step30();      // Select
    step31();      // Set
    step32();      // Select
    step33();      // Make
    step34();      // Set
    step35();      // Select
    step36();      // Set
    step37();      // Invert
    step38();      // Layer Via Copy
    step39();      // Set
    step40();      // Select
    step41();      // Select
    step42();      // Select
    step43();      // Select
    step44();      // Set
    step45();      // Select
    step46();      // Select
    step47();      // Select
    step48();      // Set
    step49();      // Make
    step50();      // Make
    step51();      // Make
    step52();      // Set
    step53();      // Select
    step54();      // Set
    step55();      // Select
    step56();      // Invert
    step57();      // Layer Via Copy
    step58();      // Select
    step59();      // Set
    step60();      // Select
    step61();      // Select
};


cTID = function (s) {
    return app.charIDToTypeID(s);
};
sTID = function (s) {
    return app.stringIDToTypeID(s);
};

//
// EyesTool.loadSymbols
//   Loading up the symbol definitions like this makes it possible
//   to include several of these generated files in one master file
//   provided a prefix is specified other than the default. It also
//   skips the definitions if PSConstants has already been loaded.
//
EyesTool.loadSymbols = function () {
    var dbgLevel = $.level;
    $.level = 0;
    try {
        PSConstants;
        return; // only if PSConstants is defined
    } 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 () {
        };
    }

    // We may still end up duplicating some of the following definitions
    // but at least we don't redefine PSClass, etc... and wipe out others
    PSClass.AdjustmentLayer = cTID('AdjL');
    PSClass.Calculation = cTID('Clcl');
    PSClass.Channel = cTID('Chnl');
    PSClass.ChannelMatrix = cTID('ChMx');
    PSClass.ChannelMixer = cTID('ChnM');
    PSClass.Curves = cTID('Crvs');
    PSClass.CurvesAdjustment = cTID('CrvA');
    PSClass.HueSatAdjustmentV2 = cTID('Hst2');
    PSClass.HueSaturation = cTID('HStr');
    PSClass.Layer = cTID('Lyr ');
    PSClass.Mask = cTID('Msk ');
    PSClass.PaintbrushTool = cTID('PbTl');
    PSClass.Point = cTID('Pnt ');
    PSClass.RGBColor = cTID('RGBC');
    PSClass.Version = cTID('Vrsn');
    PSEnum.Best = cTID('Bst ');
    PSEnum.Blue = cTID('Bl  ');
    PSEnum.ColorBurn = cTID('CBrn');
    PSEnum.Composite = cTID('Cmps');
    PSEnum.HideAll = cTID('HdAl');
    PSEnum.Luminosity = cTID('Lmns');
    PSEnum.Merged = cTID('Mrgd');
    PSEnum.Midtones = cTID('Mdtn');
    PSEnum.None = cTID('None');
    PSEnum.Overlay = cTID('Ovrl');
    PSEnum.RGB = cTID('RGB ');
    PSEnum.SoftLight = cTID('SftL');
    PSEnum.Target = cTID('Trgt');
    PSEnum.Zoom = cTID('Zm  ');
    PSEvent.Delete = cTID('Dlt ');
    PSEvent.Duplicate = cTID('Dplc');
    PSEvent.Hide = cTID('Hd  ');
    PSEvent.Invert = cTID('Invr');
    PSEvent.Make = cTID('Mk  ');
    PSEvent.Select = cTID('slct');
    PSEvent.Set = cTID('setd');
    PSEvent.Show = cTID('Shw ');
    PSKey.Adjustment = cTID('Adjs');
    PSKey.Amount = cTID('Amnt');
    PSKey.At = cTID('At  ');
    PSKey.BeginRamp = cTID('BgnR');
    PSKey.BeginSustain = cTID('BgnS');
    PSKey.BlurMethod = cTID('BlrM');
    PSKey.BlurQuality = cTID('BlrQ');
    PSKey.Color = cTID('Clr ');
    PSKey.Colorize = cTID('Clrz');
    PSKey.Colors = cTID('Clrs');
    PSKey.Constrain = cTID('Cnst');
    PSKey.Curve = cTID('Crv ');
    PSKey.EndRamp = cTID('EndR');
    PSKey.EndSustain = cTID('EndS');
    PSKey.FillNeutral = cTID('FlNt');
    PSKey.From = cTID('From');
    PSKey.Gray = cTID('Gry ');
    PSKey.Green = cTID('Grn ');
    PSKey.Horizontal = cTID('Hrzn');
    PSKey.Hue = cTID('H   ');
    PSKey.Lightness = cTID('Lght');
    PSKey.LocalRange = cTID('LclR');
    PSKey.MakeVisible = cTID('MkVs');
    PSKey.Mode = cTID('Md  ');
    PSKey.Monochromatic = cTID('Mnch');
    PSKey.Name = cTID('Nm  ');
    PSKey.New = cTID('Nw  ');
    PSKey.Opacity = cTID('Opct');
    PSKey.Radius = cTID('Rds ');
    PSKey.Red = cTID('Rd  ');
    PSKey.Start = cTID('Strt');
    PSKey.Threshold = cTID('Thsh');
    PSKey.To = cTID('T   ');
    PSKey.Type = cTID('Type');
    PSKey.Using = cTID('Usng');
    PSKey.Vertical = cTID('Vrtc');
    PSKey.With = cTID('With');
    PSString.Null = sTID('null');
    PSString.addToSelectionContinuous = sTID('addToSelectionContinuous');
    PSString.contentLayer = sTID('contentLayer');
    PSString.layerGroup = sTID('layerSection');
    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');
    PSString.solidColorLayer = sTID('solidColorLayer');
    PSType.BlendMode = cTID('BlnM');
    PSType.Ordinal = cTID('Ordn');
    PSType.UserMaskOptions = cTID('UsrM');
    PSUnit.Percent = cTID('#Prc');
    PSUnit.Pixels = cTID('#Pxl');
};

EyesTool.loadSymbols(); // load up our symbols


//=========================================
//                    EyesTool.main
//=========================================
//

EyesTool.main = function () {
    EyesTool();
};

EyesTool.main();

// EOF

3.作者寄语

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


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

上一篇:Golang在不同平台交叉编译的方法


下一篇:Windows Docker 固定容器IP地址 透明网络驱动程序