$._ext_W1={
    run : function() {
//
// Generated Thu Aug 20 2015 16:12:20 GMT+0400
//

//
//==================== HDR ==============
//
function HDR() {
  // 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);
    var desc2 = new ActionDescriptor();
    desc2.putString(PSKey.Name, "WB");
    desc1.putObject(PSKey.Using, PSClass.Layer, desc2);
    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);
  };

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

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

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

  // Fill
  function step6(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var desc1 = new ActionDescriptor();
    desc1.putEnumerated(PSKey.Using, PSType.FillContents, PSClass.Color);
    var desc2 = new ActionDescriptor();
    desc2.putUnitDouble(PSKey.Hue, PSUnit.Angle, 0);
    desc2.putDouble(PSKey.Start, 0);
    desc2.putDouble(PSKey.Brightness, 50.0007629510948);
    desc1.putObject(PSClass.Color, PSClass.HSBColor, desc2);
    desc1.putUnitDouble(PSKey.Opacity, PSUnit.Percent, 100);
    desc1.putEnumerated(PSKey.Mode, PSType.BlendMode, PSEnum.Normal);
    executeAction(PSEvent.Fill, desc1, dialogMode);
  };

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

  // Fill
  function step8(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var desc1 = new ActionDescriptor();
    desc1.putEnumerated(PSKey.Using, PSType.FillContents, PSClass.Color);
    var desc2 = new ActionDescriptor();
    desc2.putDouble(PSKey.Luminance, 54);
    desc2.putDouble(PSString.a, 0);
    desc2.putDouble(PSString.b, 5);
    desc1.putObject(PSClass.Color, PSClass.LabColor, desc2);
    desc1.putUnitDouble(PSKey.Opacity, PSUnit.Percent, 100);
    desc1.putEnumerated(PSKey.Mode, PSType.BlendMode, PSEnum.Normal);
    executeAction(PSEvent.Fill, desc1, dialogMode);
  };

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

  // Merge Layers
  function step10(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var desc1 = new ActionDescriptor();
    executeAction(sTID('mergeLayersNew'), desc1, dialogMode);
  };

  // Set
  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.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);
  };

  // Set
  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.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSString.Null, ref1);
    desc1.putEnumerated(PSKey.To, PSType.Ordinal, PSEnum.All);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

  // Subtract
  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.Channel, PSClass.Channel, PSEnum.RGB);
    desc1.putReference(PSString.Null, ref1);
    var ref2 = new ActionReference();
    ref2.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSKey.From, ref2);
    executeAction(PSEvent.Subtract, desc1, dialogMode);
  };

  // Make
  function step14(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var desc1 = new ActionDescriptor();
    var desc2 = new ActionDescriptor();
    desc2.putString(PSKey.Name, "Darks");
    desc2.putEnumerated(PSKey.ColorIndicates, PSType.MaskIndicator, PSEnum.MaskedAreas);
    var desc3 = new ActionDescriptor();
    desc3.putDouble(PSKey.Red, 255);
    desc3.putDouble(PSKey.Green, 0);
    desc3.putDouble(PSKey.Blue, 0);
    desc2.putObject(PSClass.Color, PSClass.RGBColor, desc3);
    desc2.putInteger(PSKey.Opacity, 50);
    desc1.putObject(PSKey.New, PSClass.Channel, desc2);
    var ref1 = new ActionReference();
    ref1.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSKey.Using, ref1);
    executeAction(PSEvent.Make, 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.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSString.Null, ref1);
    desc1.putEnumerated(PSKey.To, PSType.Ordinal, PSEnum.None);
    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.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSString.Null, ref1);
    var ref2 = new ActionReference();
    ref2.putName(PSClass.Channel, "Darks");
    desc1.putReference(PSKey.To, ref2);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

  // Intersect
  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.putName(PSClass.Channel, "Darks");
    desc1.putReference(PSString.Null, ref1);
    var ref2 = new ActionReference();
    ref2.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSKey.With, ref2);
    executeAction(PSEvent.Intersect, desc1, dialogMode);
  };

  // Make
  function step18(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var desc1 = new ActionDescriptor();
    var desc2 = new ActionDescriptor();
    desc2.putString(PSKey.Name, "Darks-");
    desc2.putEnumerated(PSKey.ColorIndicates, PSType.MaskIndicator, PSEnum.MaskedAreas);
    var desc3 = new ActionDescriptor();
    desc3.putDouble(PSKey.Red, 255);
    desc3.putDouble(PSKey.Green, 0);
    desc3.putDouble(PSKey.Blue, 0);
    desc2.putObject(PSClass.Color, PSClass.RGBColor, desc3);
    desc2.putInteger(PSKey.Opacity, 50);
    desc1.putObject(PSKey.New, PSClass.Channel, desc2);
    var ref1 = new ActionReference();
    ref1.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSKey.Using, ref1);
    executeAction(PSEvent.Make, desc1, dialogMode);
  };

  // Set
  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.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSString.Null, ref1);
    desc1.putEnumerated(PSKey.To, PSType.Ordinal, PSEnum.None);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

  // Set
  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.Channel, PSString.selection);
    desc1.putReference(PSString.Null, ref1);
    var ref2 = new ActionReference();
    ref2.putName(PSClass.Channel, "Darks-");
    desc1.putReference(PSKey.To, ref2);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

  // Intersect
  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.putName(PSClass.Channel, "Darks-");
    desc1.putReference(PSString.Null, ref1);
    var ref2 = new ActionReference();
    ref2.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSKey.With, ref2);
    executeAction(PSEvent.Intersect, desc1, dialogMode);
  };

  // Make
  function step22(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var desc1 = new ActionDescriptor();
    var desc2 = new ActionDescriptor();
    desc2.putString(PSKey.Name, "Darks--");
    desc2.putEnumerated(PSKey.ColorIndicates, PSType.MaskIndicator, PSEnum.MaskedAreas);
    var desc3 = new ActionDescriptor();
    desc3.putDouble(PSKey.Red, 255);
    desc3.putDouble(PSKey.Green, 0);
    desc3.putDouble(PSKey.Blue, 0);
    desc2.putObject(PSClass.Color, PSClass.RGBColor, desc3);
    desc2.putInteger(PSKey.Opacity, 50);
    desc1.putObject(PSKey.New, PSClass.Channel, desc2);
    var ref1 = new ActionReference();
    ref1.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSKey.Using, ref1);
    executeAction(PSEvent.Make, desc1, dialogMode);
  };

  // Set
  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.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSString.Null, ref1);
    desc1.putEnumerated(PSKey.To, PSType.Ordinal, PSEnum.None);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

  // Set
  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.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSString.Null, ref1);
    var ref2 = new ActionReference();
    ref2.putName(PSClass.Channel, "Darks--");
    desc1.putReference(PSKey.To, ref2);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

  // Intersect
  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.putName(PSClass.Channel, "Darks--");
    desc1.putReference(PSString.Null, ref1);
    var ref2 = new ActionReference();
    ref2.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSKey.With, ref2);
    executeAction(PSEvent.Intersect, desc1, dialogMode);
  };

  // Make
  function step26(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var desc1 = new ActionDescriptor();
    var desc2 = new ActionDescriptor();
    desc2.putString(PSKey.Name, "Darks---");
    desc2.putEnumerated(PSKey.ColorIndicates, PSType.MaskIndicator, PSEnum.MaskedAreas);
    var desc3 = new ActionDescriptor();
    desc3.putDouble(PSKey.Red, 255);
    desc3.putDouble(PSKey.Green, 0);
    desc3.putDouble(PSKey.Blue, 0);
    desc2.putObject(PSClass.Color, PSClass.RGBColor, desc3);
    desc2.putInteger(PSKey.Opacity, 50);
    desc1.putObject(PSKey.New, PSClass.Channel, desc2);
    var ref1 = new ActionReference();
    ref1.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSKey.Using, ref1);
    executeAction(PSEvent.Make, 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.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSString.Null, ref1);
    desc1.putEnumerated(PSKey.To, PSType.Ordinal, PSEnum.None);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

  // Set
  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.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSString.Null, ref1);
    var ref2 = new ActionReference();
    ref2.putName(PSClass.Channel, "Darks---");
    desc1.putReference(PSKey.To, ref2);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

  // Make
  function step29(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var desc1 = new ActionDescriptor();
    var ref1 = new ActionReference();
    ref1.putClass(PSClass.AdjustmentLayer);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    desc2.putString(PSKey.Name, "Dark Darks");
    desc2.putUnitDouble(PSKey.Opacity, PSUnit.Percent, 60);
    desc2.putEnumerated(PSKey.Mode, PSType.BlendMode, PSEnum.Multiply);
    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);
  };

  // Set
  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.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSString.Null, ref1);
    var ref2 = new ActionReference();
    ref2.putName(PSClass.Channel, "Darks--");
    desc1.putReference(PSKey.To, ref2);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

  // Make
  function step31(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var desc1 = new ActionDescriptor();
    var ref1 = new ActionReference();
    ref1.putClass(PSClass.AdjustmentLayer);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    desc2.putString(PSKey.Name, "Darks HDR");
    desc2.putEnumerated(PSKey.Mode, PSType.BlendMode, PSEnum.Screen);
    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);
  };

  // Set
  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.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSString.Null, ref1);
    var ref2 = new ActionReference();
    ref2.putEnumerated(PSClass.Channel, PSClass.Channel, PSEnum.RGB);
    desc1.putReference(PSKey.To, ref2);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

  // Make
  function step33(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var desc1 = new ActionDescriptor();
    var desc2 = new ActionDescriptor();
    desc2.putString(PSKey.Name, "Lights");
    desc2.putEnumerated(PSKey.ColorIndicates, PSType.MaskIndicator, PSEnum.MaskedAreas);
    var desc3 = new ActionDescriptor();
    desc3.putDouble(PSKey.Red, 255);
    desc3.putDouble(PSKey.Green, 0);
    desc3.putDouble(PSKey.Blue, 0);
    desc2.putObject(PSClass.Color, PSClass.RGBColor, desc3);
    desc2.putInteger(PSKey.Opacity, 50);
    desc1.putObject(PSKey.New, PSClass.Channel, desc2);
    var ref1 = new ActionReference();
    ref1.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSKey.Using, ref1);
    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.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSString.Null, ref1);
    desc1.putEnumerated(PSKey.To, PSType.Ordinal, PSEnum.None);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

  // Set
  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.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSString.Null, ref1);
    var ref2 = new ActionReference();
    ref2.putName(PSClass.Channel, "Lights");
    desc1.putReference(PSKey.To, ref2);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

  // Intersect
  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.putName(PSClass.Channel, "Lights");
    desc1.putReference(PSString.Null, ref1);
    var ref2 = new ActionReference();
    ref2.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSKey.With, ref2);
    executeAction(PSEvent.Intersect, desc1, dialogMode);
  };

  // Make
  function step37(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var desc1 = new ActionDescriptor();
    var desc2 = new ActionDescriptor();
    desc2.putString(PSKey.Name, "Lights+");
    desc2.putEnumerated(PSKey.ColorIndicates, PSType.MaskIndicator, PSEnum.MaskedAreas);
    var desc3 = new ActionDescriptor();
    desc3.putDouble(PSKey.Red, 255);
    desc3.putDouble(PSKey.Green, 0);
    desc3.putDouble(PSKey.Blue, 0);
    desc2.putObject(PSClass.Color, PSClass.RGBColor, desc3);
    desc2.putInteger(PSKey.Opacity, 50);
    desc1.putObject(PSKey.New, PSClass.Channel, desc2);
    var ref1 = new ActionReference();
    ref1.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSKey.Using, ref1);
    executeAction(PSEvent.Make, desc1, dialogMode);
  };

  // Set
  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.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSString.Null, ref1);
    desc1.putEnumerated(PSKey.To, PSType.Ordinal, PSEnum.None);
    executeAction(PSEvent.Set, desc1, 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.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSString.Null, ref1);
    var ref2 = new ActionReference();
    ref2.putName(PSClass.Channel, "Lights+");
    desc1.putReference(PSKey.To, ref2);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

  // Intersect
  function step40(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var desc1 = new ActionDescriptor();
    var ref1 = new ActionReference();
    ref1.putName(PSClass.Channel, "Lights+");
    desc1.putReference(PSString.Null, ref1);
    var ref2 = new ActionReference();
    ref2.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSKey.With, ref2);
    executeAction(PSEvent.Intersect, desc1, dialogMode);
  };

  // Make
  function step41(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var desc1 = new ActionDescriptor();
    var desc2 = new ActionDescriptor();
    desc2.putString(PSKey.Name, "Lights++");
    desc2.putEnumerated(PSKey.ColorIndicates, PSType.MaskIndicator, PSEnum.MaskedAreas);
    var desc3 = new ActionDescriptor();
    desc3.putDouble(PSKey.Red, 255);
    desc3.putDouble(PSKey.Green, 0);
    desc3.putDouble(PSKey.Blue, 0);
    desc2.putObject(PSClass.Color, PSClass.RGBColor, desc3);
    desc2.putInteger(PSKey.Opacity, 50);
    desc1.putObject(PSKey.New, PSClass.Channel, desc2);
    var ref1 = new ActionReference();
    ref1.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSKey.Using, ref1);
    executeAction(PSEvent.Make, desc1, dialogMode);
  };

  // Set
  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.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSString.Null, ref1);
    desc1.putEnumerated(PSKey.To, PSType.Ordinal, PSEnum.None);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

  // Set
  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.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSString.Null, ref1);
    var ref2 = new ActionReference();
    ref2.putName(PSClass.Channel, "Lights++");
    desc1.putReference(PSKey.To, ref2);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

  // Make
  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.putClass(PSClass.AdjustmentLayer);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    desc2.putString(PSKey.Name, "Light Lights");
    desc2.putUnitDouble(PSKey.Opacity, PSUnit.Percent, 60);
    desc2.putEnumerated(PSKey.Mode, PSType.BlendMode, PSEnum.Screen);
    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);
  };

  // Set
  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.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSString.Null, ref1);
    var ref2 = new ActionReference();
    ref2.putName(PSClass.Channel, "Lights+");
    desc1.putReference(PSKey.To, ref2);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

  // Make
  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.putClass(PSClass.AdjustmentLayer);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    desc2.putString(PSKey.Name, "Lights HDR");
    desc2.putEnumerated(PSKey.Mode, PSType.BlendMode, PSEnum.Multiply);
    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);
  };

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

  // Select
  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, "Dark Darks");
    desc1.putReference(PSString.Null, ref1);
    desc1.putEnumerated(PSString.selectionModifier, PSString.selectionModifierType, PSString.addToSelectionContinuous);
    desc1.putBoolean(PSKey.MakeVisible, false);
    executeAction(PSEvent.Select, 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(PSString.layerGroup);
    desc1.putReference(PSString.Null, ref1);
    var ref2 = new ActionReference();
    ref2.putEnumerated(PSClass.Layer, PSType.Ordinal, PSEnum.Target);
    desc1.putReference(PSKey.From, ref2);
    var desc2 = new ActionDescriptor();
    desc2.putString(PSKey.Name, "HDR");
    desc1.putObject(PSKey.Using, PSString.layerGroup, desc2);
    executeAction(PSEvent.Make, desc1, dialogMode);
  };

  // Delete
  function step50(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var desc1 = new ActionDescriptor();
    var ref1 = new ActionReference();
    ref1.putName(PSClass.Channel, "Darks-");
    desc1.putReference(PSString.Null, ref1);
    executeAction(PSEvent.Delete, desc1, dialogMode);
  };

  // Delete
  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.putName(PSClass.Channel, "Darks--");
    desc1.putReference(PSString.Null, ref1);
    executeAction(PSEvent.Delete, desc1, dialogMode);
  };

  // Delete
  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.Channel, "Darks---");
    desc1.putReference(PSString.Null, ref1);
    executeAction(PSEvent.Delete, desc1, dialogMode);
  };

  // Delete
  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.putName(PSClass.Channel, "Lights");
    desc1.putReference(PSString.Null, ref1);
    executeAction(PSEvent.Delete, desc1, dialogMode);
  };

  // Delete
  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.Channel, "Lights+");
    desc1.putReference(PSString.Null, ref1);
    executeAction(PSEvent.Delete, desc1, dialogMode);
  };

  // Delete
  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.putName(PSClass.Channel, "Lights++");
    desc1.putReference(PSString.Null, ref1);
    executeAction(PSEvent.Delete, desc1, dialogMode);
  };

  // Delete
  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.putName(PSClass.Channel, "Darks");
    desc1.putReference(PSString.Null, ref1);
    executeAction(PSEvent.Delete, desc1, dialogMode);
  };

  // Set
  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.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSString.Null, ref1);
    desc1.putEnumerated(PSKey.To, PSType.Ordinal, PSEnum.All);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

  // Subtract
  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);
    var ref2 = new ActionReference();
    ref2.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSKey.From, ref2);
    executeAction(PSEvent.Subtract, desc1, dialogMode);
  };

  // Make
  function step59(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var desc1 = new ActionDescriptor();
    var desc2 = new ActionDescriptor();
    desc2.putString(PSKey.Name, "Temp");
    desc2.putEnumerated(PSKey.ColorIndicates, PSType.MaskIndicator, PSEnum.MaskedAreas);
    var desc3 = new ActionDescriptor();
    desc3.putDouble(PSKey.Red, 255);
    desc3.putDouble(PSKey.Green, 0);
    desc3.putDouble(PSKey.Blue, 0);
    desc2.putObject(PSClass.Color, PSClass.RGBColor, desc3);
    desc2.putInteger(PSKey.Opacity, 50);
    desc1.putObject(PSKey.New, PSClass.Channel, desc2);
    var ref1 = new ActionReference();
    ref1.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSKey.Using, ref1);
    executeAction(PSEvent.Make, desc1, dialogMode);
  };

  // Set
  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.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSString.Null, ref1);
    desc1.putEnumerated(PSKey.To, PSType.Ordinal, PSEnum.None);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

  // Set
  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.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSString.Null, ref1);
    desc1.putEnumerated(PSKey.To, PSType.Ordinal, PSEnum.All);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

  // Subtract
  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.Channel, PSClass.Channel, PSEnum.RGB);
    desc1.putReference(PSString.Null, ref1);
    var ref2 = new ActionReference();
    ref2.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSKey.From, ref2);
    executeAction(PSEvent.Subtract, desc1, dialogMode);
  };

  // Subtract
  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.putName(PSClass.Channel, "Temp");
    desc1.putReference(PSString.Null, ref1);
    var ref2 = new ActionReference();
    ref2.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSKey.From, ref2);
    executeAction(PSEvent.Subtract, desc1, dialogMode);
  };

  // Make
  function step64(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);
  };

  // Set
  function step65(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, 0);
    desc4.putDouble(PSKey.Vertical, 0);
    list2.putObject(PSClass.Point, desc4);
    var desc5 = new ActionDescriptor();
    desc5.putDouble(PSKey.Horizontal, 64);
    desc5.putDouble(PSKey.Vertical, 30);
    list2.putObject(PSClass.Point, desc5);
    var desc6 = new ActionDescriptor();
    desc6.putDouble(PSKey.Horizontal, 128);
    desc6.putDouble(PSKey.Vertical, 128);
    list2.putObject(PSClass.Point, desc6);
    var desc7 = new ActionDescriptor();
    desc7.putDouble(PSKey.Horizontal, 192);
    desc7.putDouble(PSKey.Vertical, 224);
    list2.putObject(PSClass.Point, desc7);
    var desc8 = new ActionDescriptor();
    desc8.putDouble(PSKey.Horizontal, 255);
    desc8.putDouble(PSKey.Vertical, 255);
    list2.putObject(PSClass.Point, desc8);
    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);
  };

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

  // Make
  function step67(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.putString(PSKey.Name, "Auto Contrast");
    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);
  };

  // Set
  function step68(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);
    desc3.putBoolean(sTID("autoMachineLearning"), true);
    desc3.putBoolean(sTID("autoFaces"), true);
    list1.putObject(PSClass.CurvesAdjustment, desc3);
    desc2.putList(PSKey.Adjustment, list1);
    desc1.putObject(PSKey.To, PSClass.Curves, desc2);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

  // Select
  function step69(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);
  };

  // Delete
  function step70(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);
  };

  // Make
  function step71(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);
    ref1.putName(PSClass.Layer, "Auto Contrast");
    desc1.putReference(PSKey.At, ref1);
    var ref2 = new ActionReference();
    ref2.putEnumerated(PSClass.Channel, PSClass.Channel, PSClass.Mask);
    ref2.putName(PSClass.Layer, "Contrast");
    desc1.putReference(PSKey.Using, ref2);
    desc1.putBoolean(PSKey.Duplicate, true);
    executeAction(PSEvent.Make, desc1, dialogMode);
  };

  // Hide
  function step72(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.putName(PSClass.Layer, "Contrast");
    list1.putReference(ref1);
    desc1.putList(PSString.Null, list1);
    executeAction(PSEvent.Hide, desc1, dialogMode);
  };

  // Hide
  function step73(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.putName(PSClass.Layer, "HDR");
    list1.putReference(ref1);
    desc1.putList(PSString.Null, list1);
    executeAction(PSEvent.Hide, desc1, dialogMode);
  };

  // Hide
  function step74(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);
  };

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

  // Make
  function step76(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, "map");
    desc2.putUnitDouble(PSKey.Opacity, PSUnit.Percent, 50);
    desc2.putEnumerated(PSKey.Mode, PSType.BlendMode, PSString.linearLight);
    desc1.putObject(PSKey.Using, PSClass.Layer, desc2);
    executeAction(PSEvent.Make, desc1, dialogMode);
  };

  // Apply Image
  function step77(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);
    desc2.putBoolean(PSEvent.Invert, true);
    desc1.putObject(PSKey.With, PSClass.Calculation, desc2);
    executeAction(sTID('applyImageEvent'), desc1, dialogMode);
  };

  // Surface Blur
  function step78(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var desc1 = new ActionDescriptor();
    desc1.putUnitDouble(PSKey.Radius, PSUnit.Pixels, 30);
    desc1.putInteger(PSKey.Threshold, 30);
    executeAction(sTID('surfaceBlur'), desc1, dialogMode);
  };

  // Make
  function step79(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, "Large Contrast");
    desc2.putEnumerated(PSKey.Mode, PSType.BlendMode, PSEnum.SoftLight);
    desc1.putObject(PSKey.Using, PSClass.Layer, desc2);
    executeAction(PSEvent.Make, desc1, dialogMode);
  };

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

  // Delete
  function step81(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, "map");
    desc1.putReference(PSString.Null, ref1);
    executeAction(PSEvent.Delete, desc1, dialogMode);
  };

  // Reduce Noise
  function step82(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var desc1 = new ActionDescriptor();
    desc1.putUnitDouble(PSEnum.ColorNoise, PSUnit.Percent, 0);
    desc1.putUnitDouble(PSKey.Sharpness, PSUnit.Percent, 0);
    desc1.putBoolean(PSString.removeJPEGArtifact, false);
    var list1 = new ActionList();
    var desc2 = new ActionDescriptor();
    var ref1 = new ActionReference();
    ref1.putEnumerated(PSClass.Channel, PSClass.Channel, PSEnum.Composite);
    desc2.putReference(PSClass.Channel, ref1);
    desc2.putInteger(PSKey.Amount, 10);
    desc2.putInteger(PSKey.EdgeFidelity, 0);
    list1.putObject(PSString.channelDenoiseParams, desc2);
    var desc3 = new ActionDescriptor();
    var ref2 = new ActionReference();
    ref2.putEnumerated(PSClass.Channel, PSClass.Channel, PSKey.Red);
    desc3.putReference(PSClass.Channel, ref2);
    desc3.putInteger(PSKey.Amount, 0);
    list1.putObject(PSString.channelDenoiseParams, desc3);
    var desc4 = new ActionDescriptor();
    var ref3 = new ActionReference();
    ref3.putEnumerated(PSClass.Channel, PSClass.Channel, PSKey.Green);
    desc4.putReference(PSClass.Channel, ref3);
    desc4.putInteger(PSKey.Amount, 0);
    list1.putObject(PSString.channelDenoiseParams, desc4);
    var desc5 = new ActionDescriptor();
    var ref4 = new ActionReference();
    ref4.putEnumerated(PSClass.Channel, PSClass.Channel, PSKey.Blue);
    desc5.putReference(PSClass.Channel, ref4);
    desc5.putInteger(PSKey.Amount, 0);
    list1.putObject(PSString.channelDenoiseParams, desc5);
    desc1.putList(PSString.channelDenoise, list1);
    desc1.putString(PSString.preset, "По умолчанию");
    executeAction(sTID('denoise'), desc1, dialogMode);
  };

  // Reduce Noise
  function step83(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var desc1 = new ActionDescriptor();
    desc1.putUnitDouble(PSEnum.ColorNoise, PSUnit.Percent, 0);
    desc1.putUnitDouble(PSKey.Sharpness, PSUnit.Percent, 0);
    desc1.putBoolean(PSString.removeJPEGArtifact, false);
    var list1 = new ActionList();
    var desc2 = new ActionDescriptor();
    var ref1 = new ActionReference();
    ref1.putEnumerated(PSClass.Channel, PSClass.Channel, PSEnum.Composite);
    desc2.putReference(PSClass.Channel, ref1);
    desc2.putInteger(PSKey.Amount, 10);
    desc2.putInteger(PSKey.EdgeFidelity, 0);
    list1.putObject(PSString.channelDenoiseParams, desc2);
    var desc3 = new ActionDescriptor();
    var ref2 = new ActionReference();
    ref2.putEnumerated(PSClass.Channel, PSClass.Channel, PSKey.Red);
    desc3.putReference(PSClass.Channel, ref2);
    desc3.putInteger(PSKey.Amount, 0);
    list1.putObject(PSString.channelDenoiseParams, desc3);
    var desc4 = new ActionDescriptor();
    var ref3 = new ActionReference();
    ref3.putEnumerated(PSClass.Channel, PSClass.Channel, PSKey.Green);
    desc4.putReference(PSClass.Channel, ref3);
    desc4.putInteger(PSKey.Amount, 0);
    list1.putObject(PSString.channelDenoiseParams, desc4);
    var desc5 = new ActionDescriptor();
    var ref4 = new ActionReference();
    ref4.putEnumerated(PSClass.Channel, PSClass.Channel, PSKey.Blue);
    desc5.putReference(PSClass.Channel, ref4);
    desc5.putInteger(PSKey.Amount, 0);
    list1.putObject(PSString.channelDenoiseParams, desc5);
    desc1.putList(PSString.channelDenoise, list1);
    desc1.putString(PSString.preset, "По умолчанию");
    executeAction(sTID('denoise'), desc1, dialogMode);
  };

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

  // Make
  function step85(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, "map");
    desc2.putUnitDouble(PSKey.Opacity, PSUnit.Percent, 50);
    desc2.putEnumerated(PSKey.Mode, PSType.BlendMode, PSString.linearLight);
    desc1.putObject(PSKey.Using, PSClass.Layer, desc2);
    executeAction(PSEvent.Make, desc1, dialogMode);
  };

  // Apply Image
  function step86(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);
    desc2.putBoolean(PSEvent.Invert, true);
    desc1.putObject(PSKey.With, PSClass.Calculation, desc2);
    executeAction(sTID('applyImageEvent'), desc1, dialogMode);
  };

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

  // Make
  function step88(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, "Medium Contrast");
    desc2.putEnumerated(PSKey.Mode, PSType.BlendMode, PSEnum.SoftLight);
    desc1.putObject(PSKey.Using, PSClass.Layer, desc2);
    executeAction(PSEvent.Make, desc1, dialogMode);
  };

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

  // Delete
  function step90(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, "map");
    desc1.putReference(PSString.Null, ref1);
    executeAction(PSEvent.Delete, desc1, dialogMode);
  };

  // Reduce Noise
  function step91(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var desc1 = new ActionDescriptor();
    desc1.putUnitDouble(PSEnum.ColorNoise, PSUnit.Percent, 0);
    desc1.putUnitDouble(PSKey.Sharpness, PSUnit.Percent, 0);
    desc1.putBoolean(PSString.removeJPEGArtifact, false);
    var list1 = new ActionList();
    var desc2 = new ActionDescriptor();
    var ref1 = new ActionReference();
    ref1.putEnumerated(PSClass.Channel, PSClass.Channel, PSEnum.Composite);
    desc2.putReference(PSClass.Channel, ref1);
    desc2.putInteger(PSKey.Amount, 10);
    desc2.putInteger(PSKey.EdgeFidelity, 0);
    list1.putObject(PSString.channelDenoiseParams, desc2);
    var desc3 = new ActionDescriptor();
    var ref2 = new ActionReference();
    ref2.putEnumerated(PSClass.Channel, PSClass.Channel, PSKey.Red);
    desc3.putReference(PSClass.Channel, ref2);
    desc3.putInteger(PSKey.Amount, 0);
    list1.putObject(PSString.channelDenoiseParams, desc3);
    var desc4 = new ActionDescriptor();
    var ref3 = new ActionReference();
    ref3.putEnumerated(PSClass.Channel, PSClass.Channel, PSKey.Green);
    desc4.putReference(PSClass.Channel, ref3);
    desc4.putInteger(PSKey.Amount, 0);
    list1.putObject(PSString.channelDenoiseParams, desc4);
    var desc5 = new ActionDescriptor();
    var ref4 = new ActionReference();
    ref4.putEnumerated(PSClass.Channel, PSClass.Channel, PSKey.Blue);
    desc5.putReference(PSClass.Channel, ref4);
    desc5.putInteger(PSKey.Amount, 0);
    list1.putObject(PSString.channelDenoiseParams, desc5);
    desc1.putList(PSString.channelDenoise, list1);
    desc1.putString(PSString.preset, "По умолчанию");
    executeAction(sTID('denoise'), desc1, dialogMode);
  };

  // Reduce Noise
  function step92(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var desc1 = new ActionDescriptor();
    desc1.putUnitDouble(PSEnum.ColorNoise, PSUnit.Percent, 0);
    desc1.putUnitDouble(PSKey.Sharpness, PSUnit.Percent, 0);
    desc1.putBoolean(PSString.removeJPEGArtifact, false);
    var list1 = new ActionList();
    var desc2 = new ActionDescriptor();
    var ref1 = new ActionReference();
    ref1.putEnumerated(PSClass.Channel, PSClass.Channel, PSEnum.Composite);
    desc2.putReference(PSClass.Channel, ref1);
    desc2.putInteger(PSKey.Amount, 10);
    desc2.putInteger(PSKey.EdgeFidelity, 0);
    list1.putObject(PSString.channelDenoiseParams, desc2);
    var desc3 = new ActionDescriptor();
    var ref2 = new ActionReference();
    ref2.putEnumerated(PSClass.Channel, PSClass.Channel, PSKey.Red);
    desc3.putReference(PSClass.Channel, ref2);
    desc3.putInteger(PSKey.Amount, 0);
    list1.putObject(PSString.channelDenoiseParams, desc3);
    var desc4 = new ActionDescriptor();
    var ref3 = new ActionReference();
    ref3.putEnumerated(PSClass.Channel, PSClass.Channel, PSKey.Green);
    desc4.putReference(PSClass.Channel, ref3);
    desc4.putInteger(PSKey.Amount, 0);
    list1.putObject(PSString.channelDenoiseParams, desc4);
    var desc5 = new ActionDescriptor();
    var ref4 = new ActionReference();
    ref4.putEnumerated(PSClass.Channel, PSClass.Channel, PSKey.Blue);
    desc5.putReference(PSClass.Channel, ref4);
    desc5.putInteger(PSKey.Amount, 0);
    list1.putObject(PSString.channelDenoiseParams, desc5);
    desc1.putList(PSString.channelDenoise, list1);
    desc1.putString(PSString.preset, "По умолчанию");
    executeAction(sTID('denoise'), desc1, dialogMode);
  };

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

  // Make
  function step94(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, "map");
    desc2.putUnitDouble(PSKey.Opacity, PSUnit.Percent, 50);
    desc2.putEnumerated(PSKey.Mode, PSType.BlendMode, PSString.linearLight);
    desc1.putObject(PSKey.Using, PSClass.Layer, desc2);
    executeAction(PSEvent.Make, desc1, dialogMode);
  };

  // Apply Image
  function step95(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);
    desc2.putBoolean(PSEvent.Invert, true);
    desc1.putObject(PSKey.With, PSClass.Calculation, desc2);
    executeAction(sTID('applyImageEvent'), desc1, dialogMode);
  };

  // Surface Blur
  function step96(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);
    desc1.putInteger(PSKey.Threshold, 15);
    executeAction(sTID('surfaceBlur'), desc1, dialogMode);
  };

  // Make
  function step97(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, "Small Contrast");
    desc2.putEnumerated(PSKey.Mode, PSType.BlendMode, PSEnum.SoftLight);
    desc1.putObject(PSKey.Using, PSClass.Layer, desc2);
    executeAction(PSEvent.Make, desc1, dialogMode);
  };

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

  // Delete
  function step99(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, "map");
    desc1.putReference(PSString.Null, ref1);
    executeAction(PSEvent.Delete, desc1, dialogMode);
  };

  // Reduce Noise
  function step100(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var desc1 = new ActionDescriptor();
    desc1.putUnitDouble(PSEnum.ColorNoise, PSUnit.Percent, 0);
    desc1.putUnitDouble(PSKey.Sharpness, PSUnit.Percent, 0);
    desc1.putBoolean(PSString.removeJPEGArtifact, false);
    var list1 = new ActionList();
    var desc2 = new ActionDescriptor();
    var ref1 = new ActionReference();
    ref1.putEnumerated(PSClass.Channel, PSClass.Channel, PSEnum.Composite);
    desc2.putReference(PSClass.Channel, ref1);
    desc2.putInteger(PSKey.Amount, 10);
    desc2.putInteger(PSKey.EdgeFidelity, 0);
    list1.putObject(PSString.channelDenoiseParams, desc2);
    var desc3 = new ActionDescriptor();
    var ref2 = new ActionReference();
    ref2.putEnumerated(PSClass.Channel, PSClass.Channel, PSKey.Red);
    desc3.putReference(PSClass.Channel, ref2);
    desc3.putInteger(PSKey.Amount, 0);
    list1.putObject(PSString.channelDenoiseParams, desc3);
    var desc4 = new ActionDescriptor();
    var ref3 = new ActionReference();
    ref3.putEnumerated(PSClass.Channel, PSClass.Channel, PSKey.Green);
    desc4.putReference(PSClass.Channel, ref3);
    desc4.putInteger(PSKey.Amount, 0);
    list1.putObject(PSString.channelDenoiseParams, desc4);
    var desc5 = new ActionDescriptor();
    var ref4 = new ActionReference();
    ref4.putEnumerated(PSClass.Channel, PSClass.Channel, PSKey.Blue);
    desc5.putReference(PSClass.Channel, ref4);
    desc5.putInteger(PSKey.Amount, 0);
    list1.putObject(PSString.channelDenoiseParams, desc5);
    desc1.putList(PSString.channelDenoise, list1);
    desc1.putString(PSString.preset, "По умолчанию");
    executeAction(sTID('denoise'), desc1, dialogMode);
  };

  // Reduce Noise
  function step101(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var desc1 = new ActionDescriptor();
    desc1.putUnitDouble(PSEnum.ColorNoise, PSUnit.Percent, 0);
    desc1.putUnitDouble(PSKey.Sharpness, PSUnit.Percent, 0);
    desc1.putBoolean(PSString.removeJPEGArtifact, false);
    var list1 = new ActionList();
    var desc2 = new ActionDescriptor();
    var ref1 = new ActionReference();
    ref1.putEnumerated(PSClass.Channel, PSClass.Channel, PSEnum.Composite);
    desc2.putReference(PSClass.Channel, ref1);
    desc2.putInteger(PSKey.Amount, 10);
    desc2.putInteger(PSKey.EdgeFidelity, 0);
    list1.putObject(PSString.channelDenoiseParams, desc2);
    var desc3 = new ActionDescriptor();
    var ref2 = new ActionReference();
    ref2.putEnumerated(PSClass.Channel, PSClass.Channel, PSKey.Red);
    desc3.putReference(PSClass.Channel, ref2);
    desc3.putInteger(PSKey.Amount, 0);
    list1.putObject(PSString.channelDenoiseParams, desc3);
    var desc4 = new ActionDescriptor();
    var ref3 = new ActionReference();
    ref3.putEnumerated(PSClass.Channel, PSClass.Channel, PSKey.Green);
    desc4.putReference(PSClass.Channel, ref3);
    desc4.putInteger(PSKey.Amount, 0);
    list1.putObject(PSString.channelDenoiseParams, desc4);
    var desc5 = new ActionDescriptor();
    var ref4 = new ActionReference();
    ref4.putEnumerated(PSClass.Channel, PSClass.Channel, PSKey.Blue);
    desc5.putReference(PSClass.Channel, ref4);
    desc5.putInteger(PSKey.Amount, 0);
    list1.putObject(PSString.channelDenoiseParams, desc5);
    desc1.putList(PSString.channelDenoise, list1);
    desc1.putString(PSString.preset, "По умолчанию");
    executeAction(sTID('denoise'), desc1, dialogMode);
  };

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

  // Make
  function step103(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);
    var desc2 = new ActionDescriptor();
    desc2.putString(PSKey.Name, "Group Local Contrast");
    desc1.putObject(PSKey.Using, PSString.layerGroup, desc2);
    executeAction(PSEvent.Make, desc1, dialogMode);
  };

  // Hide
  function step104(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);
  };

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

  // Make
  function step106(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, "map");
    desc2.putUnitDouble(PSKey.Opacity, PSUnit.Percent, 50);
    desc2.putEnumerated(PSKey.Mode, PSType.BlendMode, PSString.linearLight);
    desc1.putObject(PSKey.Using, PSClass.Layer, desc2);
    executeAction(PSEvent.Make, desc1, dialogMode);
  };

  // Apply Image
  function step107(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);
    desc2.putBoolean(PSEvent.Invert, true);
    desc1.putObject(PSKey.With, PSClass.Calculation, desc2);
    executeAction(sTID('applyImageEvent'), desc1, dialogMode);
  };

  // Surface Blur
  function step108(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var desc1 = new ActionDescriptor();
    desc1.putUnitDouble(PSKey.Radius, PSUnit.Pixels, 4);
    desc1.putInteger(PSKey.Threshold, 8);
    executeAction(sTID('surfaceBlur'), desc1, dialogMode);
  };

  // Make
  function step109(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, "Large Sharp");
    desc2.putEnumerated(PSKey.Mode, PSType.BlendMode, PSEnum.SoftLight);
    desc1.putObject(PSKey.Using, PSClass.Layer, desc2);
    executeAction(PSEvent.Make, desc1, dialogMode);
  };

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

  // Delete
  function step111(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, "map");
    desc1.putReference(PSString.Null, ref1);
    executeAction(PSEvent.Delete, desc1, dialogMode);
  };

  // Hide
  function step112(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);
  };

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

  // Make
  function step114(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, "map");
    desc2.putUnitDouble(PSKey.Opacity, PSUnit.Percent, 50);
    desc2.putEnumerated(PSKey.Mode, PSType.BlendMode, PSString.linearLight);
    desc1.putObject(PSKey.Using, PSClass.Layer, desc2);
    executeAction(PSEvent.Make, desc1, dialogMode);
  };

  // Apply Image
  function step115(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);
    desc2.putBoolean(PSEvent.Invert, true);
    desc1.putObject(PSKey.With, PSClass.Calculation, desc2);
    executeAction(sTID('applyImageEvent'), desc1, dialogMode);
  };

  // Surface Blur
  function step116(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var desc1 = new ActionDescriptor();
    desc1.putUnitDouble(PSKey.Radius, PSUnit.Pixels, 2);
    desc1.putInteger(PSKey.Threshold, 8);
    executeAction(sTID('surfaceBlur'), desc1, dialogMode);
  };

  // Make
  function step117(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, "Medium Sharp");
    desc2.putEnumerated(PSKey.Mode, PSType.BlendMode, PSEnum.Overlay);
    desc1.putObject(PSKey.Using, PSClass.Layer, desc2);
    executeAction(PSEvent.Make, desc1, dialogMode);
  };

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

  // Delete
  function step119(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, "map");
    desc1.putReference(PSString.Null, ref1);
    executeAction(PSEvent.Delete, desc1, dialogMode);
  };

  // Hide
  function step120(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);
  };

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

  // Make
  function step122(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, "Small Sharp");
    desc2.putEnumerated(PSKey.Mode, PSType.BlendMode, PSEnum.Overlay);
    desc1.putObject(PSKey.Using, PSClass.Layer, desc2);
    executeAction(PSEvent.Make, desc1, dialogMode);
  };

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

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

  // Hide
  function step125(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);
  };

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

  // Make
  function step127(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, "Super Small Sharp");
    desc2.putEnumerated(PSKey.Mode, PSType.BlendMode, PSEnum.Overlay);
    desc1.putObject(PSKey.Using, PSClass.Layer, desc2);
    executeAction(PSEvent.Make, desc1, dialogMode);
  };

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

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

  // Show
  function step130(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.putName(PSClass.Layer, "Small Sharp");
    list1.putReference(ref1);
    desc1.putList(PSString.Null, list1);
    executeAction(PSEvent.Show, desc1, dialogMode);
  };

  // Show
  function step131(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.putName(PSClass.Layer, "Medium Sharp");
    list1.putReference(ref1);
    desc1.putList(PSString.Null, list1);
    executeAction(PSEvent.Show, desc1, dialogMode);
  };

  // Show
  function step132(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.putName(PSClass.Layer, "Large Sharp");
    list1.putReference(ref1);
    desc1.putList(PSString.Null, list1);
    executeAction(PSEvent.Show, desc1, dialogMode);
  };

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

  // Make
  function step134(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);
    var desc2 = new ActionDescriptor();
    desc2.putString(PSKey.Name, "Group Sharp");
    desc1.putObject(PSKey.Using, PSString.layerGroup, desc2);
    executeAction(PSEvent.Make, desc1, dialogMode);
  };

  // Show
  function step135(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.putName(PSClass.Layer, "Group Local Contrast");
    list1.putReference(ref1);
    desc1.putList(PSString.Null, list1);
    executeAction(PSEvent.Show, desc1, dialogMode);
  };

  // Show
  function step136(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.putName(PSClass.Layer, "Auto Contrast");
    list1.putReference(ref1);
    desc1.putList(PSString.Null, list1);
    executeAction(PSEvent.Show, desc1, dialogMode);
  };

  // Show
  function step137(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.putName(PSClass.Layer, "Contrast");
    list1.putReference(ref1);
    desc1.putList(PSString.Null, list1);
    executeAction(PSEvent.Show, desc1, dialogMode);
  };

  // Show
  function step138(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.putName(PSClass.Layer, "HDR");
    list1.putReference(ref1);
    desc1.putList(PSString.Null, list1);
    executeAction(PSEvent.Show, desc1, dialogMode);
  };

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

  // Move
  function step140(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 ref2 = new ActionReference();
    ref2.putEnumerated(PSClass.Layer, PSType.Ordinal, PSEnum.Front);
    desc1.putReference(PSKey.To, ref2);
    executeAction(PSEvent.Move, desc1, dialogMode);
  };

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

  // Move
  function step142(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 ref2 = new ActionReference();
    ref2.putEnumerated(PSClass.Layer, PSType.Ordinal, PSEnum.Front);
    desc1.putReference(PSKey.To, ref2);
    executeAction(PSEvent.Move, desc1, dialogMode);
  };

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

  // Move
  function step144(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 ref2 = new ActionReference();
    ref2.putEnumerated(PSClass.Layer, PSType.Ordinal, PSEnum.Front);
    desc1.putReference(PSKey.To, ref2);
    executeAction(PSEvent.Move, desc1, dialogMode);
  };

  // Move
  function step145(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 ref2 = new ActionReference();
    ref2.putEnumerated(PSClass.Layer, PSType.Ordinal, PSEnum.Front);
    desc1.putReference(PSKey.To, ref2);
    executeAction(PSEvent.Move, desc1, dialogMode);
  };

  // Select
  function step146(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 step147(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, "Punch Darks");
    desc1.putObject(PSKey.To, PSClass.Layer, desc2);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

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

  // Move
  function step149(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 ref2 = new ActionReference();
    ref2.putEnumerated(PSClass.Layer, PSType.Ordinal, PSEnum.Front);
    desc1.putReference(PSKey.To, ref2);
    executeAction(PSEvent.Move, desc1, dialogMode);
  };

  // Move
  function step150(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 ref2 = new ActionReference();
    ref2.putEnumerated(PSClass.Layer, PSType.Ordinal, PSEnum.Front);
    desc1.putReference(PSKey.To, ref2);
    executeAction(PSEvent.Move, desc1, dialogMode);
  };

  // Select
  function step151(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 step152(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, "Punch Lights");
    desc1.putObject(PSKey.To, PSClass.Layer, desc2);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

  // Set
  function step153(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.RGB);
    desc1.putReference(PSKey.To, ref2);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

  // Intersect
  function step154(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);
    var ref2 = new ActionReference();
    ref2.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSKey.With, ref2);
    executeAction(PSEvent.Intersect, desc1, dialogMode);
  };

  // Make
  function step155(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.putString(PSKey.Name, "Punch Lights+");
    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);
  };

  // Set
  function step156(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);
  };

  // Set
  function step157(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.All);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

  // Subtract
  function step158(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);
    var ref2 = new ActionReference();
    ref2.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSKey.From, ref2);
    executeAction(PSEvent.Subtract, desc1, dialogMode);
  };

  // Subtract
  function step159(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);
    var ref2 = new ActionReference();
    ref2.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSKey.From, ref2);
    executeAction(PSEvent.Subtract, desc1, dialogMode);
  };

  // Make
  function step160(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.putString(PSKey.Name, "Punch Blacks+");
    desc2.putEnumerated(PSKey.Mode, PSType.BlendMode, PSEnum.SoftLight);
    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);
  };

  // Hide
  function step161(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);
  };

  // Hide
  function step162(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.putName(PSClass.Layer, "Punch Lights+");
    list1.putReference(ref1);
    desc1.putList(PSString.Null, list1);
    executeAction(PSEvent.Hide, desc1, dialogMode);
  };

  // Hide
  function step163(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.putName(PSClass.Layer, "Punch Blacks+");
    list1.putReference(ref1);
    desc1.putList(PSString.Null, list1);
    executeAction(PSEvent.Hide, desc1, dialogMode);
  };

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

  // Make
  function step165(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.putString(PSKey.Name, "Low Key");
    var desc3 = new ActionDescriptor();
    desc3.putEnumerated(PSString.presetKind, PSString.presetKindType, PSString.presetKindDefault);
    desc3.putDouble(PSKey.Exposure, 0);
    desc3.putDouble(PSKey.Offset, 0);
    desc3.putDouble(PSString.gammaCorrection, 1);
    desc2.putObject(PSKey.Type, PSKey.Exposure, desc3);
    desc1.putObject(PSKey.Using, PSClass.AdjustmentLayer, desc2);
    executeAction(PSEvent.Make, desc1, dialogMode);
  };

  // Set
  function step166(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);
    desc2.putDouble(PSKey.Exposure, -0.80000001192093);
    desc1.putObject(PSKey.To, PSKey.Exposure, desc2);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

  // Make
  function step167(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.putString(PSKey.Name, "High Key");
    var desc3 = new ActionDescriptor();
    desc3.putEnumerated(PSString.presetKind, PSString.presetKindType, PSString.presetKindDefault);
    desc3.putDouble(PSKey.Exposure, 0);
    desc3.putDouble(PSKey.Offset, 0);
    desc3.putDouble(PSString.gammaCorrection, 1);
    desc2.putObject(PSKey.Type, PSKey.Exposure, desc3);
    desc1.putObject(PSKey.Using, PSClass.AdjustmentLayer, desc2);
    executeAction(PSEvent.Make, desc1, dialogMode);
  };

  // Set
  function step168(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);
    desc2.putDouble(PSKey.Exposure, 0.69999998807907);
    desc1.putObject(PSKey.To, PSKey.Exposure, desc2);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

  // Hide
  function step169(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.putName(PSClass.Layer, "High Key");
    list1.putReference(ref1);
    desc1.putList(PSString.Null, list1);
    executeAction(PSEvent.Hide, desc1, dialogMode);
  };

  // Hide
  function step170(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.putName(PSClass.Layer, "Low Key");
    list1.putReference(ref1);
    desc1.putList(PSString.Null, list1);
    executeAction(PSEvent.Hide, desc1, dialogMode);
  };

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

  // Select
  function step172(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, "Punch Blacks+");
    desc1.putReference(PSString.Null, ref1);
    desc1.putEnumerated(PSString.selectionModifier, PSString.selectionModifierType, PSString.addToSelectionContinuous);
    desc1.putBoolean(PSKey.MakeVisible, false);
    executeAction(PSEvent.Select, desc1, dialogMode);
  };

  // Make
  function step173(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);
  };

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

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

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

  // Make
  function step177(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);
  };

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

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

  // Set
  function step180(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);
  };

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

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

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

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

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

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

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

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

  step1();      // Make
  step2();      // Merge Visible
  step3();      // Average
  step4();      // Invert
  step5();      // Make
  step6();      // Fill
  step7();      // Make
  step8();      // Fill
  step9();      // Select
  step10();      // Merge Layers
  step11(true, true);      // Set
  step12();      // Set
  step13();      // Subtract
  step14();      // Make
  step15();      // Set
  step16();      // Set
  step17();      // Intersect
  step18();      // Make
  step19();      // Set
  step20();      // Set
  step21();      // Intersect
  step22();      // Make
  step23();      // Set
  step24();      // Set
  step25();      // Intersect
  step26();      // Make
  step27();      // Set
  step28();      // Set
  step29();      // Make
  step30();      // Set
  step31();      // Make
  step32();      // Set
  step33();      // Make
  step34();      // Set
  step35();      // Set
  step36();      // Intersect
  step37();      // Make
  step38();      // Set
  step39();      // Set
  step40();      // Intersect
  step41();      // Make
  step42();      // Set
  step43();      // Set
  step44();      // Make
  step45();      // Set
  step46();      // Make
  step47();      // Select
  step48();      // Select
  step49();      // Make
  step50();      // Delete
  step51();      // Delete
  step52();      // Delete
  step53();      // Delete
  step54();      // Delete
  step55();      // Delete
  step56();      // Delete
  step57();      // Set
  step58();      // Subtract
  step59();      // Make
  step60();      // Set
  step61();      // Set
  step62();      // Subtract
  step63();      // Subtract
  step64();      // Make
  step65();      // Set
  step66();      // Set
  step67();      // Make
  step68();      // Set
  step69();      // Select
  step70();      // Delete
  step71();      // Make
  step72();      // Hide
  step73();      // Hide
  step74();      // Hide
  step75();      // Select
  step76();      // Make
  step77();      // Apply Image
  step78();      // Surface Blur
  step79();      // Make
  step80();      // Apply Image
  step81();      // Delete
  step82();      // Reduce Noise
  step83();      // Reduce Noise
  step84();      // Select
  step85();      // Make
  step86();      // Apply Image
  step87();      // Surface Blur
  step88();      // Make
  step89();      // Apply Image
  step90();      // Delete
  step91();      // Reduce Noise
  step92();      // Reduce Noise
  step93();      // Select
  step94();      // Make
  step95();      // Apply Image
  step96();      // Surface Blur
  step97();      // Make
  step98();      // Apply Image
  step99();      // Delete
  step100();      // Reduce Noise
  step101();      // Reduce Noise
  step102();      // Select
  step103();      // Make
  step104();      // Hide
  step105();      // Select
  step106();      // Make
  step107();      // Apply Image
  step108();      // Surface Blur
  step109();      // Make
  step110();      // Apply Image
  step111();      // Delete
  step112();      // Hide
  step113();      // Select
  step114();      // Make
  step115();      // Apply Image
  step116();      // Surface Blur
  step117();      // Make
  step118();      // Apply Image
  step119();      // Delete
  step120();      // Hide
  step121();      // Select
  step122();      // Make
  step123();      // Apply Image
  step124();      // High Pass
  step125();      // Hide
  step126();      // Select
  step127();      // Make
  step128();      // Apply Image
  step129();      // High Pass
  step130();      // Show
  step131();      // Show
  step132();      // Show
  step133();      // Select
  step134();      // Make
  step135();      // Show
  step136();      // Show
  step137();      // Show
  step138();      // Show
  step139();      // Select
  step140();      // Move
  step141();      // Select
  step142();      // Move
  step143();      // Select
  step144();      // Move
  step145();      // Move
  step146();      // Select
  step147();      // Set
  step148();      // Select
  step149();      // Move
  step150();      // Move
  step151();      // Select
  step152();      // Set
  step153();      // Set
  step154();      // Intersect
  step155();      // Make
  step156();      // Set
  step157();      // Set
  step158();      // Subtract
  step159();      // Subtract
  step160();      // Make
  step161();      // Hide
  step162();      // Hide
  step163();      // Hide
  step164();      // Select
  step165();      // Make
  step166();      // Set
  step167();      // Make
  step168();      // Set
  step169();      // Hide
  step170();      // Hide
  step171();      // Select
  step172();      // Select
  step173();      // Make
  step174();      // Set
  step175();      // Select
  step176();      // Select
  step177();      // Make
  step178();      // Set
  step179();      // Select
  step180();      // Set
  step181();      // Select
  step182();      // Set
  step183();      // Select
  step184();      // Set
  step185();      // Select
  step186();      // Set
  step187();      // Select
  step188();      // Set
};



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

//
// HDR.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.
//
HDR.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.Color = cTID('Clr ');
  PSClass.Curves = cTID('Crvs');
  PSClass.CurvesAdjustment = cTID('CrvA');
  PSClass.HSBColor = cTID('HSBC');
  PSClass.LabColor = cTID('LbCl');
  PSClass.Layer = cTID('Lyr ');
  PSClass.Mask = cTID('Msk ');
  PSClass.Point = cTID('Pnt ');
  PSClass.RGBColor = cTID('RGBC');
  PSEnum.All = cTID('Al  ');
  PSEnum.ColorNoise = cTID('ClNs');
  PSEnum.Composite = cTID('Cmps');
  PSEnum.Front = cTID('Frnt');
  PSEnum.Gray = cTID('Gry ');
  PSEnum.Luminosity = cTID('Lmns');
  PSEnum.MaskedAreas = cTID('MskA');
  PSEnum.Merged = cTID('Mrgd');
  PSEnum.Multiply = cTID('Mltp');
  PSEnum.None = cTID('None');
  PSEnum.Normal = cTID('Nrml');
  PSEnum.Overlay = cTID('Ovrl');
  PSEnum.RGB = cTID('RGB ');
  PSEnum.Screen = cTID('Scrn');
  PSEnum.SoftLight = cTID('SftL');
  PSEnum.Target = cTID('Trgt');
  PSEnum.YellowColor = cTID('Ylw ');
  PSEvent.Average = cTID('Avrg');
  PSEvent.Delete = cTID('Dlt ');
  PSEvent.Fill = cTID('Fl  ');
  PSEvent.Hide = cTID('Hd  ');
  PSEvent.Intersect = cTID('Intr');
  PSEvent.Invert = cTID('Invr');
  PSEvent.Make = cTID('Mk  ');
  PSEvent.Move = cTID('move');
  PSEvent.Select = cTID('slct');
  PSEvent.Set = cTID('setd');
  PSEvent.Show = cTID('Shw ');
  PSEvent.Subtract = cTID('Sbtr');
  PSKey.Adjustment = cTID('Adjs');
  PSKey.Amount = cTID('Amnt');
  PSKey.At = cTID('At  ');
  PSKey.Blue = cTID('Bl  ');
  PSKey.Brightness = cTID('Brgh');
  PSKey.ColorIndicates = cTID('ClrI');
  PSKey.Curve = cTID('Crv ');
  PSKey.Duplicate = cTID('Dplc');
  PSKey.EdgeFidelity = cTID('EdgF');
  PSKey.Exposure = cTID('Exps');
  PSKey.From = cTID('From');
  PSKey.Green = cTID('Grn ');
  PSKey.Horizontal = cTID('Hrzn');
  PSKey.Hue = cTID('H   ');
  PSKey.Luminance = cTID('Lmnc');
  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.Sharpness = cTID('Shrp');
  PSKey.Start = cTID('Strt');
  PSKey.Threshold = cTID('Thsh');
  PSKey.To = cTID('T   ');
  PSKey.Type = cTID('Type');
  PSKey.Using = cTID('Usng');
  PSKey.Vertical = cTID('Vrtc');
  PSKey.With = cTID('With');
  PSString.Null = sTID('null');
  PSString.a = sTID('a');
  PSString.addToSelectionContinuous = sTID('addToSelectionContinuous');
  PSString.b = sTID('b');
  PSString.channelDenoise = sTID('channelDenoise');
  PSString.channelDenoiseParams = sTID('channelDenoiseParams');
  PSString.gammaCorrection = sTID('gammaCorrection');
  PSString.layerGroup = sTID('layerSection');
  PSString.linearLight = sTID('linearLight');
  PSString.preset = sTID('preset');
  PSString.presetKind = sTID('presetKind');
  PSString.presetKindCustom = sTID('presetKindCustom');
  PSString.presetKindDefault = sTID('presetKindDefault');
  PSString.presetKindType = sTID('presetKindType');
  PSString.removeJPEGArtifact = sTID('removeJPEGArtifact');
  PSString.selection = sTID('selection');
  PSString.selectionModifier = sTID('selectionModifier');
  PSString.selectionModifierType = sTID('selectionModifierType');
  PSType.BlendMode = cTID('BlnM');
  PSType.FillContents = cTID('FlCn');
  PSType.MaskIndicator = cTID('MskI');
  PSType.Ordinal = cTID('Ordn');
  PSUnit.Angle = cTID('#Ang');
  PSUnit.Percent = cTID('#Prc');
  PSUnit.Pixels = cTID('#Pxl');
};

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



//=========================================
//                    HDR.main
//=========================================
//

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

HDR.main();

// EOF

    },
};

$._ext_W2={
    run : function() {
//
// Generated Thu Aug 20 2015 16:12:20 GMT+0400
//

//
//==================== HDR X2 ==============
//
function HDRX2() {
  // 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);
    var desc2 = new ActionDescriptor();
    desc2.putString(PSKey.Name, "WB");
    desc1.putObject(PSKey.Using, PSClass.Layer, desc2);
    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);
  };

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

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

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

  // Fill
  function step6(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var desc1 = new ActionDescriptor();
    desc1.putEnumerated(PSKey.Using, PSType.FillContents, PSClass.Color);
    var desc2 = new ActionDescriptor();
    desc2.putUnitDouble(PSKey.Hue, PSUnit.Angle, 0);
    desc2.putDouble(PSKey.Start, 0);
    desc2.putDouble(PSKey.Brightness, 50.0007629510948);
    desc1.putObject(PSClass.Color, PSClass.HSBColor, desc2);
    desc1.putUnitDouble(PSKey.Opacity, PSUnit.Percent, 100);
    desc1.putEnumerated(PSKey.Mode, PSType.BlendMode, PSEnum.Normal);
    executeAction(PSEvent.Fill, desc1, dialogMode);
  };

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

  // Fill
  function step8(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var desc1 = new ActionDescriptor();
    desc1.putEnumerated(PSKey.Using, PSType.FillContents, PSClass.Color);
    var desc2 = new ActionDescriptor();
    desc2.putDouble(PSKey.Luminance, 54);
    desc2.putDouble(PSString.a, 0);
    desc2.putDouble(PSString.b, 5);
    desc1.putObject(PSClass.Color, PSClass.LabColor, desc2);
    desc1.putUnitDouble(PSKey.Opacity, PSUnit.Percent, 100);
    desc1.putEnumerated(PSKey.Mode, PSType.BlendMode, PSEnum.Normal);
    executeAction(PSEvent.Fill, desc1, dialogMode);
  };

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

  // Merge Layers
  function step10(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var desc1 = new ActionDescriptor();
    executeAction(sTID('mergeLayersNew'), desc1, dialogMode);
  };

  // Set
  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.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);
  };

  // Set
  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.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSString.Null, ref1);
    desc1.putEnumerated(PSKey.To, PSType.Ordinal, PSEnum.All);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

  // Subtract
  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.Channel, PSClass.Channel, PSEnum.RGB);
    desc1.putReference(PSString.Null, ref1);
    var ref2 = new ActionReference();
    ref2.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSKey.From, ref2);
    executeAction(PSEvent.Subtract, desc1, dialogMode);
  };

  // Make
  function step14(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var desc1 = new ActionDescriptor();
    var desc2 = new ActionDescriptor();
    desc2.putString(PSKey.Name, "Darks");
    desc2.putEnumerated(PSKey.ColorIndicates, PSType.MaskIndicator, PSEnum.MaskedAreas);
    var desc3 = new ActionDescriptor();
    desc3.putDouble(PSKey.Red, 255);
    desc3.putDouble(PSKey.Green, 0);
    desc3.putDouble(PSKey.Blue, 0);
    desc2.putObject(PSClass.Color, PSClass.RGBColor, desc3);
    desc2.putInteger(PSKey.Opacity, 50);
    desc1.putObject(PSKey.New, PSClass.Channel, desc2);
    var ref1 = new ActionReference();
    ref1.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSKey.Using, ref1);
    executeAction(PSEvent.Make, 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.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSString.Null, ref1);
    desc1.putEnumerated(PSKey.To, PSType.Ordinal, PSEnum.None);
    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.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSString.Null, ref1);
    var ref2 = new ActionReference();
    ref2.putName(PSClass.Channel, "Darks");
    desc1.putReference(PSKey.To, ref2);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

  // Intersect
  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.putName(PSClass.Channel, "Darks");
    desc1.putReference(PSString.Null, ref1);
    var ref2 = new ActionReference();
    ref2.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSKey.With, ref2);
    executeAction(PSEvent.Intersect, desc1, dialogMode);
  };

  // Make
  function step18(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var desc1 = new ActionDescriptor();
    var desc2 = new ActionDescriptor();
    desc2.putString(PSKey.Name, "Darks-");
    desc2.putEnumerated(PSKey.ColorIndicates, PSType.MaskIndicator, PSEnum.MaskedAreas);
    var desc3 = new ActionDescriptor();
    desc3.putDouble(PSKey.Red, 255);
    desc3.putDouble(PSKey.Green, 0);
    desc3.putDouble(PSKey.Blue, 0);
    desc2.putObject(PSClass.Color, PSClass.RGBColor, desc3);
    desc2.putInteger(PSKey.Opacity, 50);
    desc1.putObject(PSKey.New, PSClass.Channel, desc2);
    var ref1 = new ActionReference();
    ref1.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSKey.Using, ref1);
    executeAction(PSEvent.Make, desc1, dialogMode);
  };

  // Set
  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.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSString.Null, ref1);
    desc1.putEnumerated(PSKey.To, PSType.Ordinal, PSEnum.None);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

  // Set
  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.Channel, PSString.selection);
    desc1.putReference(PSString.Null, ref1);
    var ref2 = new ActionReference();
    ref2.putName(PSClass.Channel, "Darks-");
    desc1.putReference(PSKey.To, ref2);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

  // Intersect
  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.putName(PSClass.Channel, "Darks-");
    desc1.putReference(PSString.Null, ref1);
    var ref2 = new ActionReference();
    ref2.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSKey.With, ref2);
    executeAction(PSEvent.Intersect, desc1, dialogMode);
  };

  // Make
  function step22(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var desc1 = new ActionDescriptor();
    var desc2 = new ActionDescriptor();
    desc2.putString(PSKey.Name, "Darks--");
    desc2.putEnumerated(PSKey.ColorIndicates, PSType.MaskIndicator, PSEnum.MaskedAreas);
    var desc3 = new ActionDescriptor();
    desc3.putDouble(PSKey.Red, 255);
    desc3.putDouble(PSKey.Green, 0);
    desc3.putDouble(PSKey.Blue, 0);
    desc2.putObject(PSClass.Color, PSClass.RGBColor, desc3);
    desc2.putInteger(PSKey.Opacity, 50);
    desc1.putObject(PSKey.New, PSClass.Channel, desc2);
    var ref1 = new ActionReference();
    ref1.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSKey.Using, ref1);
    executeAction(PSEvent.Make, desc1, dialogMode);
  };

  // Set
  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.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSString.Null, ref1);
    desc1.putEnumerated(PSKey.To, PSType.Ordinal, PSEnum.None);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

  // Set
  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.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSString.Null, ref1);
    var ref2 = new ActionReference();
    ref2.putName(PSClass.Channel, "Darks--");
    desc1.putReference(PSKey.To, ref2);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

  // Intersect
  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.putName(PSClass.Channel, "Darks--");
    desc1.putReference(PSString.Null, ref1);
    var ref2 = new ActionReference();
    ref2.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSKey.With, ref2);
    executeAction(PSEvent.Intersect, desc1, dialogMode);
  };

  // Make
  function step26(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var desc1 = new ActionDescriptor();
    var desc2 = new ActionDescriptor();
    desc2.putString(PSKey.Name, "Darks---");
    desc2.putEnumerated(PSKey.ColorIndicates, PSType.MaskIndicator, PSEnum.MaskedAreas);
    var desc3 = new ActionDescriptor();
    desc3.putDouble(PSKey.Red, 255);
    desc3.putDouble(PSKey.Green, 0);
    desc3.putDouble(PSKey.Blue, 0);
    desc2.putObject(PSClass.Color, PSClass.RGBColor, desc3);
    desc2.putInteger(PSKey.Opacity, 50);
    desc1.putObject(PSKey.New, PSClass.Channel, desc2);
    var ref1 = new ActionReference();
    ref1.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSKey.Using, ref1);
    executeAction(PSEvent.Make, 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.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSString.Null, ref1);
    desc1.putEnumerated(PSKey.To, PSType.Ordinal, PSEnum.None);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

  // Set
  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.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSString.Null, ref1);
    var ref2 = new ActionReference();
    ref2.putName(PSClass.Channel, "Darks---");
    desc1.putReference(PSKey.To, ref2);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

  // Make
  function step29(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var desc1 = new ActionDescriptor();
    var ref1 = new ActionReference();
    ref1.putClass(PSClass.AdjustmentLayer);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    desc2.putString(PSKey.Name, "Dark Darks");
    desc2.putUnitDouble(PSKey.Opacity, PSUnit.Percent, 60);
    desc2.putEnumerated(PSKey.Mode, PSType.BlendMode, PSEnum.Multiply);
    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);
  };

  // Set
  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.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSString.Null, ref1);
    var ref2 = new ActionReference();
    ref2.putName(PSClass.Channel, "Darks--");
    desc1.putReference(PSKey.To, ref2);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

  // Make
  function step31(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var desc1 = new ActionDescriptor();
    var ref1 = new ActionReference();
    ref1.putClass(PSClass.AdjustmentLayer);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    desc2.putString(PSKey.Name, "Darks HDR");
    desc2.putEnumerated(PSKey.Mode, PSType.BlendMode, PSEnum.Screen);
    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);
  };

  // Set
  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.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSString.Null, ref1);
    var ref2 = new ActionReference();
    ref2.putEnumerated(PSClass.Channel, PSClass.Channel, PSEnum.RGB);
    desc1.putReference(PSKey.To, ref2);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

  // Make
  function step33(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var desc1 = new ActionDescriptor();
    var desc2 = new ActionDescriptor();
    desc2.putString(PSKey.Name, "Lights");
    desc2.putEnumerated(PSKey.ColorIndicates, PSType.MaskIndicator, PSEnum.MaskedAreas);
    var desc3 = new ActionDescriptor();
    desc3.putDouble(PSKey.Red, 255);
    desc3.putDouble(PSKey.Green, 0);
    desc3.putDouble(PSKey.Blue, 0);
    desc2.putObject(PSClass.Color, PSClass.RGBColor, desc3);
    desc2.putInteger(PSKey.Opacity, 50);
    desc1.putObject(PSKey.New, PSClass.Channel, desc2);
    var ref1 = new ActionReference();
    ref1.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSKey.Using, ref1);
    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.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSString.Null, ref1);
    desc1.putEnumerated(PSKey.To, PSType.Ordinal, PSEnum.None);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

  // Set
  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.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSString.Null, ref1);
    var ref2 = new ActionReference();
    ref2.putName(PSClass.Channel, "Lights");
    desc1.putReference(PSKey.To, ref2);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

  // Intersect
  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.putName(PSClass.Channel, "Lights");
    desc1.putReference(PSString.Null, ref1);
    var ref2 = new ActionReference();
    ref2.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSKey.With, ref2);
    executeAction(PSEvent.Intersect, desc1, dialogMode);
  };

  // Make
  function step37(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var desc1 = new ActionDescriptor();
    var desc2 = new ActionDescriptor();
    desc2.putString(PSKey.Name, "Lights+");
    desc2.putEnumerated(PSKey.ColorIndicates, PSType.MaskIndicator, PSEnum.MaskedAreas);
    var desc3 = new ActionDescriptor();
    desc3.putDouble(PSKey.Red, 255);
    desc3.putDouble(PSKey.Green, 0);
    desc3.putDouble(PSKey.Blue, 0);
    desc2.putObject(PSClass.Color, PSClass.RGBColor, desc3);
    desc2.putInteger(PSKey.Opacity, 50);
    desc1.putObject(PSKey.New, PSClass.Channel, desc2);
    var ref1 = new ActionReference();
    ref1.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSKey.Using, ref1);
    executeAction(PSEvent.Make, desc1, dialogMode);
  };

  // Set
  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.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSString.Null, ref1);
    desc1.putEnumerated(PSKey.To, PSType.Ordinal, PSEnum.None);
    executeAction(PSEvent.Set, desc1, 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.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSString.Null, ref1);
    var ref2 = new ActionReference();
    ref2.putName(PSClass.Channel, "Lights+");
    desc1.putReference(PSKey.To, ref2);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

  // Intersect
  function step40(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var desc1 = new ActionDescriptor();
    var ref1 = new ActionReference();
    ref1.putName(PSClass.Channel, "Lights+");
    desc1.putReference(PSString.Null, ref1);
    var ref2 = new ActionReference();
    ref2.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSKey.With, ref2);
    executeAction(PSEvent.Intersect, desc1, dialogMode);
  };

  // Make
  function step41(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var desc1 = new ActionDescriptor();
    var desc2 = new ActionDescriptor();
    desc2.putString(PSKey.Name, "Lights++");
    desc2.putEnumerated(PSKey.ColorIndicates, PSType.MaskIndicator, PSEnum.MaskedAreas);
    var desc3 = new ActionDescriptor();
    desc3.putDouble(PSKey.Red, 255);
    desc3.putDouble(PSKey.Green, 0);
    desc3.putDouble(PSKey.Blue, 0);
    desc2.putObject(PSClass.Color, PSClass.RGBColor, desc3);
    desc2.putInteger(PSKey.Opacity, 50);
    desc1.putObject(PSKey.New, PSClass.Channel, desc2);
    var ref1 = new ActionReference();
    ref1.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSKey.Using, ref1);
    executeAction(PSEvent.Make, desc1, dialogMode);
  };

  // Set
  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.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSString.Null, ref1);
    desc1.putEnumerated(PSKey.To, PSType.Ordinal, PSEnum.None);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

  // Set
  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.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSString.Null, ref1);
    var ref2 = new ActionReference();
    ref2.putName(PSClass.Channel, "Lights++");
    desc1.putReference(PSKey.To, ref2);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

  // Make
  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.putClass(PSClass.AdjustmentLayer);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    desc2.putString(PSKey.Name, "Light Lights");
    desc2.putUnitDouble(PSKey.Opacity, PSUnit.Percent, 60);
    desc2.putEnumerated(PSKey.Mode, PSType.BlendMode, PSEnum.Screen);
    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);
  };

  // Set
  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.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSString.Null, ref1);
    var ref2 = new ActionReference();
    ref2.putName(PSClass.Channel, "Lights+");
    desc1.putReference(PSKey.To, ref2);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

  // Make
  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.putClass(PSClass.AdjustmentLayer);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    desc2.putString(PSKey.Name, "Lights HDR");
    desc2.putEnumerated(PSKey.Mode, PSType.BlendMode, PSEnum.Multiply);
    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);
  };

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

  // Select
  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, "Dark Darks");
    desc1.putReference(PSString.Null, ref1);
    desc1.putEnumerated(PSString.selectionModifier, PSString.selectionModifierType, PSString.addToSelectionContinuous);
    desc1.putBoolean(PSKey.MakeVisible, false);
    executeAction(PSEvent.Select, 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(PSString.layerGroup);
    desc1.putReference(PSString.Null, ref1);
    var ref2 = new ActionReference();
    ref2.putEnumerated(PSClass.Layer, PSType.Ordinal, PSEnum.Target);
    desc1.putReference(PSKey.From, ref2);
    var desc2 = new ActionDescriptor();
    desc2.putString(PSKey.Name, "HDR");
    desc1.putObject(PSKey.Using, PSString.layerGroup, desc2);
    executeAction(PSEvent.Make, desc1, dialogMode);
  };

  // Delete
  function step50(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var desc1 = new ActionDescriptor();
    var ref1 = new ActionReference();
    ref1.putName(PSClass.Channel, "Darks-");
    desc1.putReference(PSString.Null, ref1);
    executeAction(PSEvent.Delete, desc1, dialogMode);
  };

  // Delete
  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.putName(PSClass.Channel, "Darks--");
    desc1.putReference(PSString.Null, ref1);
    executeAction(PSEvent.Delete, desc1, dialogMode);
  };

  // Delete
  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.Channel, "Darks---");
    desc1.putReference(PSString.Null, ref1);
    executeAction(PSEvent.Delete, desc1, dialogMode);
  };

  // Delete
  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.putName(PSClass.Channel, "Lights");
    desc1.putReference(PSString.Null, ref1);
    executeAction(PSEvent.Delete, desc1, dialogMode);
  };

  // Delete
  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.Channel, "Lights+");
    desc1.putReference(PSString.Null, ref1);
    executeAction(PSEvent.Delete, desc1, dialogMode);
  };

  // Delete
  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.putName(PSClass.Channel, "Lights++");
    desc1.putReference(PSString.Null, ref1);
    executeAction(PSEvent.Delete, desc1, dialogMode);
  };

  // Delete
  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.putName(PSClass.Channel, "Darks");
    desc1.putReference(PSString.Null, ref1);
    executeAction(PSEvent.Delete, desc1, dialogMode);
  };

  // Set
  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.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSString.Null, ref1);
    desc1.putEnumerated(PSKey.To, PSType.Ordinal, PSEnum.All);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

  // Subtract
  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);
    var ref2 = new ActionReference();
    ref2.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSKey.From, ref2);
    executeAction(PSEvent.Subtract, desc1, dialogMode);
  };

  // Make
  function step59(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var desc1 = new ActionDescriptor();
    var desc2 = new ActionDescriptor();
    desc2.putString(PSKey.Name, "Temp");
    desc2.putEnumerated(PSKey.ColorIndicates, PSType.MaskIndicator, PSEnum.MaskedAreas);
    var desc3 = new ActionDescriptor();
    desc3.putDouble(PSKey.Red, 255);
    desc3.putDouble(PSKey.Green, 0);
    desc3.putDouble(PSKey.Blue, 0);
    desc2.putObject(PSClass.Color, PSClass.RGBColor, desc3);
    desc2.putInteger(PSKey.Opacity, 50);
    desc1.putObject(PSKey.New, PSClass.Channel, desc2);
    var ref1 = new ActionReference();
    ref1.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSKey.Using, ref1);
    executeAction(PSEvent.Make, desc1, dialogMode);
  };

  // Set
  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.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSString.Null, ref1);
    desc1.putEnumerated(PSKey.To, PSType.Ordinal, PSEnum.None);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

  // Set
  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.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSString.Null, ref1);
    desc1.putEnumerated(PSKey.To, PSType.Ordinal, PSEnum.All);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

  // Subtract
  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.Channel, PSClass.Channel, PSEnum.RGB);
    desc1.putReference(PSString.Null, ref1);
    var ref2 = new ActionReference();
    ref2.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSKey.From, ref2);
    executeAction(PSEvent.Subtract, desc1, dialogMode);
  };

  // Subtract
  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.putName(PSClass.Channel, "Temp");
    desc1.putReference(PSString.Null, ref1);
    var ref2 = new ActionReference();
    ref2.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSKey.From, ref2);
    executeAction(PSEvent.Subtract, desc1, dialogMode);
  };

  // Make
  function step64(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);
  };

  // Set
  function step65(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, 0);
    desc4.putDouble(PSKey.Vertical, 0);
    list2.putObject(PSClass.Point, desc4);
    var desc5 = new ActionDescriptor();
    desc5.putDouble(PSKey.Horizontal, 64);
    desc5.putDouble(PSKey.Vertical, 30);
    list2.putObject(PSClass.Point, desc5);
    var desc6 = new ActionDescriptor();
    desc6.putDouble(PSKey.Horizontal, 128);
    desc6.putDouble(PSKey.Vertical, 128);
    list2.putObject(PSClass.Point, desc6);
    var desc7 = new ActionDescriptor();
    desc7.putDouble(PSKey.Horizontal, 192);
    desc7.putDouble(PSKey.Vertical, 224);
    list2.putObject(PSClass.Point, desc7);
    var desc8 = new ActionDescriptor();
    desc8.putDouble(PSKey.Horizontal, 255);
    desc8.putDouble(PSKey.Vertical, 255);
    list2.putObject(PSClass.Point, desc8);
    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);
  };

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

  // Make
  function step67(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.putString(PSKey.Name, "Auto Contrast");
    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);
  };

  // Set
  function step68(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);
    desc3.putBoolean(sTID("autoMachineLearning"), true);
    desc3.putBoolean(sTID("autoFaces"), true);
    list1.putObject(PSClass.CurvesAdjustment, desc3);
    desc2.putList(PSKey.Adjustment, list1);
    desc1.putObject(PSKey.To, PSClass.Curves, desc2);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

  // Select
  function step69(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);
  };

  // Delete
  function step70(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);
  };

  // Make
  function step71(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);
    ref1.putName(PSClass.Layer, "Auto Contrast");
    desc1.putReference(PSKey.At, ref1);
    var ref2 = new ActionReference();
    ref2.putEnumerated(PSClass.Channel, PSClass.Channel, PSClass.Mask);
    ref2.putName(PSClass.Layer, "Contrast");
    desc1.putReference(PSKey.Using, ref2);
    desc1.putBoolean(PSKey.Duplicate, true);
    executeAction(PSEvent.Make, desc1, dialogMode);
  };

  // Hide
  function step72(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.putName(PSClass.Layer, "Contrast");
    list1.putReference(ref1);
    desc1.putList(PSString.Null, list1);
    executeAction(PSEvent.Hide, desc1, dialogMode);
  };

  // Hide
  function step73(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.putName(PSClass.Layer, "HDR");
    list1.putReference(ref1);
    desc1.putList(PSString.Null, list1);
    executeAction(PSEvent.Hide, desc1, dialogMode);
  };

  // Hide
  function step74(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);
  };

  // Make
  function step75(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, "Boost Detail Map");
    desc2.putUnitDouble(PSKey.Opacity, PSUnit.Percent, 50);
    desc2.putEnumerated(PSKey.Mode, PSType.BlendMode, PSString.linearLight);
    desc1.putObject(PSKey.Using, PSClass.Layer, desc2);
    executeAction(PSEvent.Make, desc1, dialogMode);
  };

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

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

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

  // Make
  function step79(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, "Boost Details");
    desc2.putEnumerated(PSKey.Mode, PSType.BlendMode, PSEnum.Overlay);
    desc1.putObject(PSKey.Using, PSClass.Layer, desc2);
    executeAction(PSEvent.Make, desc1, dialogMode);
  };

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

  // Delete
  function step81(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, "Boost Detail Map");
    desc1.putReference(PSString.Null, ref1);
    executeAction(PSEvent.Delete, desc1, dialogMode);
  };

  // Reduce Noise
  function step82(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var desc1 = new ActionDescriptor();
    desc1.putUnitDouble(PSEnum.ColorNoise, PSUnit.Percent, 0);
    desc1.putUnitDouble(PSKey.Sharpness, PSUnit.Percent, 0);
    desc1.putBoolean(PSString.removeJPEGArtifact, false);
    var list1 = new ActionList();
    var desc2 = new ActionDescriptor();
    var ref1 = new ActionReference();
    ref1.putEnumerated(PSClass.Channel, PSClass.Channel, PSEnum.Composite);
    desc2.putReference(PSClass.Channel, ref1);
    desc2.putInteger(PSKey.Amount, 10);
    desc2.putInteger(PSKey.EdgeFidelity, 0);
    list1.putObject(PSString.channelDenoiseParams, desc2);
    var desc3 = new ActionDescriptor();
    var ref2 = new ActionReference();
    ref2.putEnumerated(PSClass.Channel, PSClass.Channel, PSKey.Red);
    desc3.putReference(PSClass.Channel, ref2);
    desc3.putInteger(PSKey.Amount, 0);
    list1.putObject(PSString.channelDenoiseParams, desc3);
    var desc4 = new ActionDescriptor();
    var ref3 = new ActionReference();
    ref3.putEnumerated(PSClass.Channel, PSClass.Channel, PSKey.Green);
    desc4.putReference(PSClass.Channel, ref3);
    desc4.putInteger(PSKey.Amount, 0);
    list1.putObject(PSString.channelDenoiseParams, desc4);
    var desc5 = new ActionDescriptor();
    var ref4 = new ActionReference();
    ref4.putEnumerated(PSClass.Channel, PSClass.Channel, PSKey.Blue);
    desc5.putReference(PSClass.Channel, ref4);
    desc5.putInteger(PSKey.Amount, 0);
    list1.putObject(PSString.channelDenoiseParams, desc5);
    desc1.putList(PSString.channelDenoise, list1);
    desc1.putString(PSString.preset, "Default");
    executeAction(sTID('denoise'), desc1, dialogMode);
  };

  // Make
  function step83(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.putString(PSKey.Name, "More Details Maker");
    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);
  };

  // Create Clipping Mask
  function step84(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);
  };

  // Set
  function step85(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, 0);
    desc4.putDouble(PSKey.Vertical, 0);
    list2.putObject(PSClass.Point, desc4);
    var desc5 = new ActionDescriptor();
    desc5.putDouble(PSKey.Horizontal, 90);
    desc5.putDouble(PSKey.Vertical, 60);
    list2.putObject(PSClass.Point, desc5);
    var desc6 = new ActionDescriptor();
    desc6.putDouble(PSKey.Horizontal, 128);
    desc6.putDouble(PSKey.Vertical, 128);
    list2.putObject(PSClass.Point, desc6);
    var desc7 = new ActionDescriptor();
    desc7.putDouble(PSKey.Horizontal, 255);
    desc7.putDouble(PSKey.Vertical, 255);
    list2.putObject(PSClass.Point, desc7);
    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);
  };

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

  // Make
  function step87(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);
  };

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

  // Hide
  function step89(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);
  };

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

  // Make
  function step91(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, "map");
    desc2.putUnitDouble(PSKey.Opacity, PSUnit.Percent, 50);
    desc2.putEnumerated(PSKey.Mode, PSType.BlendMode, PSString.linearLight);
    desc1.putObject(PSKey.Using, PSClass.Layer, desc2);
    executeAction(PSEvent.Make, desc1, dialogMode);
  };

  // Apply Image
  function step92(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);
    desc2.putBoolean(PSEvent.Invert, true);
    desc1.putObject(PSKey.With, PSClass.Calculation, desc2);
    executeAction(sTID('applyImageEvent'), desc1, dialogMode);
  };

  // Surface Blur
  function step93(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var desc1 = new ActionDescriptor();
    desc1.putUnitDouble(PSKey.Radius, PSUnit.Pixels, 4);
    desc1.putInteger(PSKey.Threshold, 8);
    executeAction(sTID('surfaceBlur'), desc1, dialogMode);
  };

  // Make
  function step94(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, "Large Sharp");
    desc2.putEnumerated(PSKey.Mode, PSType.BlendMode, PSEnum.SoftLight);
    desc1.putObject(PSKey.Using, PSClass.Layer, desc2);
    executeAction(PSEvent.Make, desc1, dialogMode);
  };

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

  // Delete
  function step96(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, "map");
    desc1.putReference(PSString.Null, ref1);
    executeAction(PSEvent.Delete, desc1, dialogMode);
  };

  // Hide
  function step97(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);
  };

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

  // Make
  function step99(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, "map");
    desc2.putUnitDouble(PSKey.Opacity, PSUnit.Percent, 50);
    desc2.putEnumerated(PSKey.Mode, PSType.BlendMode, PSString.linearLight);
    desc1.putObject(PSKey.Using, PSClass.Layer, desc2);
    executeAction(PSEvent.Make, desc1, dialogMode);
  };

  // Apply Image
  function step100(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);
    desc2.putBoolean(PSEvent.Invert, true);
    desc1.putObject(PSKey.With, PSClass.Calculation, desc2);
    executeAction(sTID('applyImageEvent'), desc1, dialogMode);
  };

  // Surface Blur
  function step101(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var desc1 = new ActionDescriptor();
    desc1.putUnitDouble(PSKey.Radius, PSUnit.Pixels, 2);
    desc1.putInteger(PSKey.Threshold, 8);
    executeAction(sTID('surfaceBlur'), desc1, dialogMode);
  };

  // Make
  function step102(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, "Medium Sharp");
    desc2.putEnumerated(PSKey.Mode, PSType.BlendMode, PSEnum.Overlay);
    desc1.putObject(PSKey.Using, PSClass.Layer, desc2);
    executeAction(PSEvent.Make, desc1, dialogMode);
  };

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

  // Delete
  function step104(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, "map");
    desc1.putReference(PSString.Null, ref1);
    executeAction(PSEvent.Delete, desc1, dialogMode);
  };

  // Hide
  function step105(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);
  };

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

  // Make
  function step107(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, "Small Sharp");
    desc2.putEnumerated(PSKey.Mode, PSType.BlendMode, PSEnum.Overlay);
    desc1.putObject(PSKey.Using, PSClass.Layer, desc2);
    executeAction(PSEvent.Make, desc1, dialogMode);
  };

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

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

  // Hide
  function step110(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);
  };

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

  // Make
  function step112(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, "Super Small Sharp");
    desc2.putEnumerated(PSKey.Mode, PSType.BlendMode, PSEnum.Overlay);
    desc1.putObject(PSKey.Using, PSClass.Layer, desc2);
    executeAction(PSEvent.Make, desc1, dialogMode);
  };

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

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

  // Show
  function step115(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.putName(PSClass.Layer, "Small Sharp");
    list1.putReference(ref1);
    desc1.putList(PSString.Null, list1);
    executeAction(PSEvent.Show, desc1, dialogMode);
  };

  // Show
  function step116(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.putName(PSClass.Layer, "Medium Sharp");
    list1.putReference(ref1);
    desc1.putList(PSString.Null, list1);
    executeAction(PSEvent.Show, desc1, dialogMode);
  };

  // Show
  function step117(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.putName(PSClass.Layer, "Large Sharp");
    list1.putReference(ref1);
    desc1.putList(PSString.Null, list1);
    executeAction(PSEvent.Show, desc1, dialogMode);
  };

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

  // Make
  function step119(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);
    var desc2 = new ActionDescriptor();
    desc2.putString(PSKey.Name, "Group Sharp");
    desc1.putObject(PSKey.Using, PSString.layerGroup, desc2);
    executeAction(PSEvent.Make, desc1, dialogMode);
  };

  // Show
  function step120(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.putName(PSClass.Layer, "Group Boost Details");
    list1.putReference(ref1);
    desc1.putList(PSString.Null, list1);
    executeAction(PSEvent.Show, desc1, dialogMode);
  };

  // Show
  function step121(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.putName(PSClass.Layer, "Auto Contrast");
    list1.putReference(ref1);
    desc1.putList(PSString.Null, list1);
    executeAction(PSEvent.Show, desc1, dialogMode);
  };

  // Show
  function step122(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.putName(PSClass.Layer, "Contrast");
    list1.putReference(ref1);
    desc1.putList(PSString.Null, list1);
    executeAction(PSEvent.Show, desc1, dialogMode);
  };

  // Show
  function step123(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.putName(PSClass.Layer, "HDR");
    list1.putReference(ref1);
    desc1.putList(PSString.Null, list1);
    executeAction(PSEvent.Show, desc1, dialogMode);
  };

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

  // Move
  function step125(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 ref2 = new ActionReference();
    ref2.putEnumerated(PSClass.Layer, PSType.Ordinal, PSEnum.Front);
    desc1.putReference(PSKey.To, ref2);
    executeAction(PSEvent.Move, desc1, dialogMode);
  };

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

  // Move
  function step127(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 ref2 = new ActionReference();
    ref2.putEnumerated(PSClass.Layer, PSType.Ordinal, PSEnum.Front);
    desc1.putReference(PSKey.To, ref2);
    executeAction(PSEvent.Move, desc1, dialogMode);
  };

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

  // Move
  function step129(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 ref2 = new ActionReference();
    ref2.putEnumerated(PSClass.Layer, PSType.Ordinal, PSEnum.Front);
    desc1.putReference(PSKey.To, ref2);
    executeAction(PSEvent.Move, desc1, dialogMode);
  };

  // Move
  function step130(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 ref2 = new ActionReference();
    ref2.putEnumerated(PSClass.Layer, PSType.Ordinal, PSEnum.Front);
    desc1.putReference(PSKey.To, ref2);
    executeAction(PSEvent.Move, desc1, dialogMode);
  };

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

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

  // Move
  function step133(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 ref2 = new ActionReference();
    ref2.putEnumerated(PSClass.Layer, PSType.Ordinal, PSEnum.Front);
    desc1.putReference(PSKey.To, ref2);
    executeAction(PSEvent.Move, desc1, dialogMode);
  };

  // Move
  function step134(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 ref2 = new ActionReference();
    ref2.putEnumerated(PSClass.Layer, PSType.Ordinal, PSEnum.Front);
    desc1.putReference(PSKey.To, ref2);
    executeAction(PSEvent.Move, desc1, dialogMode);
  };

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

  // Set
  function step136(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.RGB);
    desc1.putReference(PSKey.To, ref2);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

  // Intersect
  function step137(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);
    var ref2 = new ActionReference();
    ref2.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSKey.With, ref2);
    executeAction(PSEvent.Intersect, desc1, dialogMode);
  };

  // Make
  function step138(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.putString(PSKey.Name, "Punch Lights+");
    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);
  };

  // Set
  function step139(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);
  };

  // Set
  function step140(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.All);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

  // Subtract
  function step141(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);
    var ref2 = new ActionReference();
    ref2.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSKey.From, ref2);
    executeAction(PSEvent.Subtract, desc1, dialogMode);
  };

  // Subtract
  function step142(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);
    var ref2 = new ActionReference();
    ref2.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSKey.From, ref2);
    executeAction(PSEvent.Subtract, desc1, dialogMode);
  };

  // Make
  function step143(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.putString(PSKey.Name, "Punch Blacks+");
    desc2.putEnumerated(PSKey.Mode, PSType.BlendMode, PSEnum.SoftLight);
    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);
  };

  // Hide
  function step144(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.putName(PSClass.Layer, "Punch Lights+");
    list1.putReference(ref1);
    desc1.putList(PSString.Null, list1);
    executeAction(PSEvent.Hide, desc1, dialogMode);
  };

  // Hide
  function step145(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.putName(PSClass.Layer, "Punch Blacks+");
    list1.putReference(ref1);
    desc1.putList(PSString.Null, list1);
    executeAction(PSEvent.Hide, desc1, dialogMode);
  };

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

  // Make
  function step147(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.putString(PSKey.Name, "Low Key");
    var desc3 = new ActionDescriptor();
    desc3.putEnumerated(PSString.presetKind, PSString.presetKindType, PSString.presetKindDefault);
    desc3.putDouble(PSKey.Exposure, 0);
    desc3.putDouble(PSKey.Offset, 0);
    desc3.putDouble(PSString.gammaCorrection, 1);
    desc2.putObject(PSKey.Type, PSKey.Exposure, desc3);
    desc1.putObject(PSKey.Using, PSClass.AdjustmentLayer, desc2);
    executeAction(PSEvent.Make, desc1, dialogMode);
  };

  // Set
  function step148(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);
    desc2.putDouble(PSKey.Exposure, -0.80000001192093);
    desc1.putObject(PSKey.To, PSKey.Exposure, desc2);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

  // Make
  function step149(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.putString(PSKey.Name, "High Key");
    var desc3 = new ActionDescriptor();
    desc3.putEnumerated(PSString.presetKind, PSString.presetKindType, PSString.presetKindDefault);
    desc3.putDouble(PSKey.Exposure, 0);
    desc3.putDouble(PSKey.Offset, 0);
    desc3.putDouble(PSString.gammaCorrection, 1);
    desc2.putObject(PSKey.Type, PSKey.Exposure, desc3);
    desc1.putObject(PSKey.Using, PSClass.AdjustmentLayer, desc2);
    executeAction(PSEvent.Make, desc1, dialogMode);
  };

  // Set
  function step150(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);
    desc2.putDouble(PSKey.Exposure, 0.69999998807907);
    desc1.putObject(PSKey.To, PSKey.Exposure, desc2);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

  // Hide
  function step151(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.putName(PSClass.Layer, "High Key");
    list1.putReference(ref1);
    desc1.putList(PSString.Null, list1);
    executeAction(PSEvent.Hide, desc1, dialogMode);
  };

  // Hide
  function step152(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.putName(PSClass.Layer, "Low Key");
    list1.putReference(ref1);
    desc1.putList(PSString.Null, list1);
    executeAction(PSEvent.Hide, desc1, dialogMode);
  };

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

  // Select
  function step154(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, "Punch Blacks+");
    desc1.putReference(PSString.Null, ref1);
    desc1.putEnumerated(PSString.selectionModifier, PSString.selectionModifierType, PSString.addToSelectionContinuous);
    desc1.putBoolean(PSKey.MakeVisible, false);
    executeAction(PSEvent.Select, desc1, dialogMode);
  };

  // Make
  function step155(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);
  };

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

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

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

  // Make
  function step159(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);
  };

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

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

  // Set
  function step162(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);
  };

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

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

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

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

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

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

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

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

  step1();      // Make
  step2();      // Merge Visible
  step3();      // Average
  step4();      // Invert
  step5();      // Make
  step6();      // Fill
  step7();      // Make
  step8();      // Fill
  step9();      // Select
  step10();      // Merge Layers
  step11(true, true);      // Set
  step12();      // Set
  step13();      // Subtract
  step14();      // Make
  step15();      // Set
  step16();      // Set
  step17();      // Intersect
  step18();      // Make
  step19();      // Set
  step20();      // Set
  step21();      // Intersect
  step22();      // Make
  step23();      // Set
  step24();      // Set
  step25();      // Intersect
  step26();      // Make
  step27();      // Set
  step28();      // Set
  step29();      // Make
  step30();      // Set
  step31();      // Make
  step32();      // Set
  step33();      // Make
  step34();      // Set
  step35();      // Set
  step36();      // Intersect
  step37();      // Make
  step38();      // Set
  step39();      // Set
  step40();      // Intersect
  step41();      // Make
  step42();      // Set
  step43();      // Set
  step44();      // Make
  step45();      // Set
  step46();      // Make
  step47();      // Select
  step48();      // Select
  step49();      // Make
  step50();      // Delete
  step51();      // Delete
  step52();      // Delete
  step53();      // Delete
  step54();      // Delete
  step55();      // Delete
  step56();      // Delete
  step57();      // Set
  step58();      // Subtract
  step59();      // Make
  step60();      // Set
  step61();      // Set
  step62();      // Subtract
  step63();      // Subtract
  step64();      // Make
  step65();      // Set
  step66();      // Set
  step67();      // Make
  step68();      // Set
  step69();      // Select
  step70();      // Delete
  step71();      // Make
  step72();      // Hide
  step73();      // Hide
  step74();      // Hide
  step75();      // Make
  step76();      // Apply Image
  step77();      // Invert
  step78();      // Surface Blur
  step79();      // Make
  step80();      // Apply Image
  step81();      // Delete
  step82();      // Reduce Noise
  step83();      // Make
  step84();      // Create Clipping Mask
  step85();      // Set
  step86();      // Select
  step87();      // Make
  step88();      // Set
  step89();      // Hide
  step90();      // Select
  step91();      // Make
  step92();      // Apply Image
  step93();      // Surface Blur
  step94();      // Make
  step95();      // Apply Image
  step96();      // Delete
  step97();      // Hide
  step98();      // Select
  step99();      // Make
  step100();      // Apply Image
  step101();      // Surface Blur
  step102();      // Make
  step103();      // Apply Image
  step104();      // Delete
  step105();      // Hide
  step106();      // Select
  step107();      // Make
  step108();      // Apply Image
  step109();      // High Pass
  step110();      // Hide
  step111();      // Select
  step112();      // Make
  step113();      // Apply Image
  step114();      // High Pass
  step115();      // Show
  step116();      // Show
  step117();      // Show
  step118();      // Select
  step119();      // Make
  step120();      // Show
  step121();      // Show
  step122();      // Show
  step123();      // Show
  step124();      // Select
  step125();      // Move
  step126();      // Select
  step127();      // Move
  step128();      // Select
  step129();      // Move
  step130();      // Move
  step131();      // Set
  step132();      // Select
  step133();      // Move
  step134();      // Move
  step135();      // Set
  step136();      // Set
  step137();      // Intersect
  step138();      // Make
  step139();      // Set
  step140();      // Set
  step141();      // Subtract
  step142();      // Subtract
  step143();      // Make
  step144();      // Hide
  step145();      // Hide
  step146();      // Select
  step147();      // Make
  step148();      // Set
  step149();      // Make
  step150();      // Set
  step151();      // Hide
  step152();      // Hide
  step153();      // Select
  step154();      // Select
  step155();      // Make
  step156();      // Set
  step157();      // Select
  step158();      // Select
  step159();      // Make
  step160();      // Set
  step161();      // Select
  step162();      // Set
  step163();      // Select
  step164();      // Set
  step165();      // Select
  step166();      // Set
  step167();      // Select
  step168();      // Set
  step169();      // Select
  step170();      // Set
};



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

//
// HDRX2.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.
//
HDRX2.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.Color = cTID('Clr ');
  PSClass.Curves = cTID('Crvs');
  PSClass.CurvesAdjustment = cTID('CrvA');
  PSClass.HSBColor = cTID('HSBC');
  PSClass.LabColor = cTID('LbCl');
  PSClass.Layer = cTID('Lyr ');
  PSClass.Mask = cTID('Msk ');
  PSClass.Point = cTID('Pnt ');
  PSClass.RGBColor = cTID('RGBC');
  PSEnum.All = cTID('Al  ');
  PSEnum.ColorNoise = cTID('ClNs');
  PSEnum.Composite = cTID('Cmps');
  PSEnum.Front = cTID('Frnt');
  PSEnum.Gray = cTID('Gry ');
  PSEnum.Luminosity = cTID('Lmns');
  PSEnum.MaskedAreas = cTID('MskA');
  PSEnum.Merged = cTID('Mrgd');
  PSEnum.Multiply = cTID('Mltp');
  PSEnum.None = cTID('None');
  PSEnum.Normal = cTID('Nrml');
  PSEnum.Overlay = cTID('Ovrl');
  PSEnum.RGB = cTID('RGB ');
  PSEnum.Screen = cTID('Scrn');
  PSEnum.SoftLight = cTID('SftL');
  PSEnum.Target = cTID('Trgt');
  PSEnum.YellowColor = cTID('Ylw ');
  PSEvent.Average = cTID('Avrg');
  PSEvent.Delete = cTID('Dlt ');
  PSEvent.Fill = cTID('Fl  ');
  PSEvent.Hide = cTID('Hd  ');
  PSEvent.Intersect = cTID('Intr');
  PSEvent.Invert = cTID('Invr');
  PSEvent.Make = cTID('Mk  ');
  PSEvent.Move = cTID('move');
  PSEvent.Select = cTID('slct');
  PSEvent.Set = cTID('setd');
  PSEvent.Show = cTID('Shw ');
  PSEvent.Subtract = cTID('Sbtr');
  PSKey.Adjustment = cTID('Adjs');
  PSKey.Amount = cTID('Amnt');
  PSKey.At = cTID('At  ');
  PSKey.Blue = cTID('Bl  ');
  PSKey.Brightness = cTID('Brgh');
  PSKey.ColorIndicates = cTID('ClrI');
  PSKey.Curve = cTID('Crv ');
  PSKey.Duplicate = cTID('Dplc');
  PSKey.EdgeFidelity = cTID('EdgF');
  PSKey.Exposure = cTID('Exps');
  PSKey.From = cTID('From');
  PSKey.Green = cTID('Grn ');
  PSKey.Horizontal = cTID('Hrzn');
  PSKey.Hue = cTID('H   ');
  PSKey.Luminance = cTID('Lmnc');
  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.Sharpness = cTID('Shrp');
  PSKey.Start = cTID('Strt');
  PSKey.Threshold = cTID('Thsh');
  PSKey.To = cTID('T   ');
  PSKey.Type = cTID('Type');
  PSKey.Using = cTID('Usng');
  PSKey.Vertical = cTID('Vrtc');
  PSKey.With = cTID('With');
  PSString.Null = sTID('null');
  PSString.a = sTID('a');
  PSString.addToSelectionContinuous = sTID('addToSelectionContinuous');
  PSString.b = sTID('b');
  PSString.channelDenoise = sTID('channelDenoise');
  PSString.channelDenoiseParams = sTID('channelDenoiseParams');
  PSString.gammaCorrection = sTID('gammaCorrection');
  PSString.layerGroup = sTID('layerSection');
  PSString.linearLight = sTID('linearLight');
  PSString.preset = sTID('preset');
  PSString.presetKind = sTID('presetKind');
  PSString.presetKindCustom = sTID('presetKindCustom');
  PSString.presetKindDefault = sTID('presetKindDefault');
  PSString.presetKindType = sTID('presetKindType');
  PSString.removeJPEGArtifact = sTID('removeJPEGArtifact');
  PSString.selection = sTID('selection');
  PSString.selectionModifier = sTID('selectionModifier');
  PSString.selectionModifierType = sTID('selectionModifierType');
  PSType.BlendMode = cTID('BlnM');
  PSType.FillContents = cTID('FlCn');
  PSType.MaskIndicator = cTID('MskI');
  PSType.Ordinal = cTID('Ordn');
  PSUnit.Angle = cTID('#Ang');
  PSUnit.Percent = cTID('#Prc');
  PSUnit.Pixels = cTID('#Pxl');
};

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



//=========================================
//                    HDRX2.main
//=========================================
//

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

HDRX2.main();

// EOF

    },
};

$._ext_W3={
    run : function() {
//
// Generated Wed Aug 26 2015 13:14:14 GMT+0400
//

//
//==================== HDR X3 ==============
//
function HDRX3() {
  // 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);
    var desc2 = new ActionDescriptor();
    desc2.putString(PSKey.Name, "WB");
    desc1.putObject(PSKey.Using, PSClass.Layer, desc2);
    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);
  };

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

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

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

  // Fill
  function step6(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var desc1 = new ActionDescriptor();
    desc1.putEnumerated(PSKey.Using, PSType.FillContents, PSClass.Color);
    var desc2 = new ActionDescriptor();
    desc2.putUnitDouble(PSKey.Hue, PSUnit.Angle, 0);
    desc2.putDouble(PSKey.Start, 0);
    desc2.putDouble(PSKey.Brightness, 50.0007629510948);
    desc1.putObject(PSClass.Color, PSClass.HSBColor, desc2);
    desc1.putUnitDouble(PSKey.Opacity, PSUnit.Percent, 100);
    desc1.putEnumerated(PSKey.Mode, PSType.BlendMode, PSEnum.Normal);
    executeAction(PSEvent.Fill, desc1, dialogMode);
  };

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

  // Fill
  function step8(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var desc1 = new ActionDescriptor();
    desc1.putEnumerated(PSKey.Using, PSType.FillContents, PSClass.Color);
    var desc2 = new ActionDescriptor();
    desc2.putDouble(PSKey.Luminance, 54);
    desc2.putDouble(PSString.a, 0);
    desc2.putDouble(PSString.b, 5);
    desc1.putObject(PSClass.Color, PSClass.LabColor, desc2);
    desc1.putUnitDouble(PSKey.Opacity, PSUnit.Percent, 100);
    desc1.putEnumerated(PSKey.Mode, PSType.BlendMode, PSEnum.Normal);
    executeAction(PSEvent.Fill, desc1, dialogMode);
  };

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

  // Merge Layers
  function step10(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var desc1 = new ActionDescriptor();
    executeAction(sTID('mergeLayersNew'), desc1, dialogMode);
  };

  // Set
  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.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);
  };

  // Set
  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.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSString.Null, ref1);
    desc1.putEnumerated(PSKey.To, PSType.Ordinal, PSEnum.All);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

  // Subtract
  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.Channel, PSClass.Channel, PSEnum.RGB);
    desc1.putReference(PSString.Null, ref1);
    var ref2 = new ActionReference();
    ref2.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSKey.From, ref2);
    executeAction(PSEvent.Subtract, desc1, dialogMode);
  };

  // Make
  function step14(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var desc1 = new ActionDescriptor();
    var desc2 = new ActionDescriptor();
    desc2.putString(PSKey.Name, "Darks");
    desc2.putEnumerated(PSKey.ColorIndicates, PSType.MaskIndicator, PSEnum.MaskedAreas);
    var desc3 = new ActionDescriptor();
    desc3.putDouble(PSKey.Red, 255);
    desc3.putDouble(PSKey.Green, 0);
    desc3.putDouble(PSKey.Blue, 0);
    desc2.putObject(PSClass.Color, PSClass.RGBColor, desc3);
    desc2.putInteger(PSKey.Opacity, 50);
    desc1.putObject(PSKey.New, PSClass.Channel, desc2);
    var ref1 = new ActionReference();
    ref1.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSKey.Using, ref1);
    executeAction(PSEvent.Make, 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.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSString.Null, ref1);
    desc1.putEnumerated(PSKey.To, PSType.Ordinal, PSEnum.None);
    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.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSString.Null, ref1);
    var ref2 = new ActionReference();
    ref2.putName(PSClass.Channel, "Darks");
    desc1.putReference(PSKey.To, ref2);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

  // Intersect
  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.putName(PSClass.Channel, "Darks");
    desc1.putReference(PSString.Null, ref1);
    var ref2 = new ActionReference();
    ref2.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSKey.With, ref2);
    executeAction(PSEvent.Intersect, desc1, dialogMode);
  };

  // Make
  function step18(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var desc1 = new ActionDescriptor();
    var desc2 = new ActionDescriptor();
    desc2.putString(PSKey.Name, "Darks-");
    desc2.putEnumerated(PSKey.ColorIndicates, PSType.MaskIndicator, PSEnum.MaskedAreas);
    var desc3 = new ActionDescriptor();
    desc3.putDouble(PSKey.Red, 255);
    desc3.putDouble(PSKey.Green, 0);
    desc3.putDouble(PSKey.Blue, 0);
    desc2.putObject(PSClass.Color, PSClass.RGBColor, desc3);
    desc2.putInteger(PSKey.Opacity, 50);
    desc1.putObject(PSKey.New, PSClass.Channel, desc2);
    var ref1 = new ActionReference();
    ref1.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSKey.Using, ref1);
    executeAction(PSEvent.Make, desc1, dialogMode);
  };

  // Set
  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.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSString.Null, ref1);
    desc1.putEnumerated(PSKey.To, PSType.Ordinal, PSEnum.None);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

  // Set
  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.Channel, PSString.selection);
    desc1.putReference(PSString.Null, ref1);
    var ref2 = new ActionReference();
    ref2.putName(PSClass.Channel, "Darks-");
    desc1.putReference(PSKey.To, ref2);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

  // Intersect
  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.putName(PSClass.Channel, "Darks-");
    desc1.putReference(PSString.Null, ref1);
    var ref2 = new ActionReference();
    ref2.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSKey.With, ref2);
    executeAction(PSEvent.Intersect, desc1, dialogMode);
  };

  // Make
  function step22(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var desc1 = new ActionDescriptor();
    var desc2 = new ActionDescriptor();
    desc2.putString(PSKey.Name, "Darks--");
    desc2.putEnumerated(PSKey.ColorIndicates, PSType.MaskIndicator, PSEnum.MaskedAreas);
    var desc3 = new ActionDescriptor();
    desc3.putDouble(PSKey.Red, 255);
    desc3.putDouble(PSKey.Green, 0);
    desc3.putDouble(PSKey.Blue, 0);
    desc2.putObject(PSClass.Color, PSClass.RGBColor, desc3);
    desc2.putInteger(PSKey.Opacity, 50);
    desc1.putObject(PSKey.New, PSClass.Channel, desc2);
    var ref1 = new ActionReference();
    ref1.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSKey.Using, ref1);
    executeAction(PSEvent.Make, desc1, dialogMode);
  };

  // Set
  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.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSString.Null, ref1);
    desc1.putEnumerated(PSKey.To, PSType.Ordinal, PSEnum.None);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

  // Set
  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.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSString.Null, ref1);
    var ref2 = new ActionReference();
    ref2.putName(PSClass.Channel, "Darks--");
    desc1.putReference(PSKey.To, ref2);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

  // Intersect
  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.putName(PSClass.Channel, "Darks--");
    desc1.putReference(PSString.Null, ref1);
    var ref2 = new ActionReference();
    ref2.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSKey.With, ref2);
    executeAction(PSEvent.Intersect, desc1, dialogMode);
  };

  // Make
  function step26(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var desc1 = new ActionDescriptor();
    var desc2 = new ActionDescriptor();
    desc2.putString(PSKey.Name, "Darks---");
    desc2.putEnumerated(PSKey.ColorIndicates, PSType.MaskIndicator, PSEnum.MaskedAreas);
    var desc3 = new ActionDescriptor();
    desc3.putDouble(PSKey.Red, 255);
    desc3.putDouble(PSKey.Green, 0);
    desc3.putDouble(PSKey.Blue, 0);
    desc2.putObject(PSClass.Color, PSClass.RGBColor, desc3);
    desc2.putInteger(PSKey.Opacity, 50);
    desc1.putObject(PSKey.New, PSClass.Channel, desc2);
    var ref1 = new ActionReference();
    ref1.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSKey.Using, ref1);
    executeAction(PSEvent.Make, 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.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSString.Null, ref1);
    desc1.putEnumerated(PSKey.To, PSType.Ordinal, PSEnum.None);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

  // Set
  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.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSString.Null, ref1);
    var ref2 = new ActionReference();
    ref2.putName(PSClass.Channel, "Darks---");
    desc1.putReference(PSKey.To, ref2);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

  // Make
  function step29(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var desc1 = new ActionDescriptor();
    var ref1 = new ActionReference();
    ref1.putClass(PSClass.AdjustmentLayer);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    desc2.putString(PSKey.Name, "Dark Darks");
    desc2.putUnitDouble(PSKey.Opacity, PSUnit.Percent, 60);
    desc2.putEnumerated(PSKey.Mode, PSType.BlendMode, PSEnum.Multiply);
    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);
  };

  // Set
  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.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSString.Null, ref1);
    var ref2 = new ActionReference();
    ref2.putName(PSClass.Channel, "Darks--");
    desc1.putReference(PSKey.To, ref2);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

  // Make
  function step31(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var desc1 = new ActionDescriptor();
    var ref1 = new ActionReference();
    ref1.putClass(PSClass.AdjustmentLayer);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    desc2.putString(PSKey.Name, "Darks HDR");
    desc2.putEnumerated(PSKey.Mode, PSType.BlendMode, PSEnum.Screen);
    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);
  };

  // Set
  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.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSString.Null, ref1);
    var ref2 = new ActionReference();
    ref2.putEnumerated(PSClass.Channel, PSClass.Channel, PSEnum.RGB);
    desc1.putReference(PSKey.To, ref2);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

  // Make
  function step33(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var desc1 = new ActionDescriptor();
    var desc2 = new ActionDescriptor();
    desc2.putString(PSKey.Name, "Lights");
    desc2.putEnumerated(PSKey.ColorIndicates, PSType.MaskIndicator, PSEnum.MaskedAreas);
    var desc3 = new ActionDescriptor();
    desc3.putDouble(PSKey.Red, 255);
    desc3.putDouble(PSKey.Green, 0);
    desc3.putDouble(PSKey.Blue, 0);
    desc2.putObject(PSClass.Color, PSClass.RGBColor, desc3);
    desc2.putInteger(PSKey.Opacity, 50);
    desc1.putObject(PSKey.New, PSClass.Channel, desc2);
    var ref1 = new ActionReference();
    ref1.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSKey.Using, ref1);
    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.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSString.Null, ref1);
    desc1.putEnumerated(PSKey.To, PSType.Ordinal, PSEnum.None);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

  // Set
  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.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSString.Null, ref1);
    var ref2 = new ActionReference();
    ref2.putName(PSClass.Channel, "Lights");
    desc1.putReference(PSKey.To, ref2);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

  // Intersect
  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.putName(PSClass.Channel, "Lights");
    desc1.putReference(PSString.Null, ref1);
    var ref2 = new ActionReference();
    ref2.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSKey.With, ref2);
    executeAction(PSEvent.Intersect, desc1, dialogMode);
  };

  // Make
  function step37(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var desc1 = new ActionDescriptor();
    var desc2 = new ActionDescriptor();
    desc2.putString(PSKey.Name, "Lights+");
    desc2.putEnumerated(PSKey.ColorIndicates, PSType.MaskIndicator, PSEnum.MaskedAreas);
    var desc3 = new ActionDescriptor();
    desc3.putDouble(PSKey.Red, 255);
    desc3.putDouble(PSKey.Green, 0);
    desc3.putDouble(PSKey.Blue, 0);
    desc2.putObject(PSClass.Color, PSClass.RGBColor, desc3);
    desc2.putInteger(PSKey.Opacity, 50);
    desc1.putObject(PSKey.New, PSClass.Channel, desc2);
    var ref1 = new ActionReference();
    ref1.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSKey.Using, ref1);
    executeAction(PSEvent.Make, desc1, dialogMode);
  };

  // Set
  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.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSString.Null, ref1);
    desc1.putEnumerated(PSKey.To, PSType.Ordinal, PSEnum.None);
    executeAction(PSEvent.Set, desc1, 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.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSString.Null, ref1);
    var ref2 = new ActionReference();
    ref2.putName(PSClass.Channel, "Lights+");
    desc1.putReference(PSKey.To, ref2);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

  // Intersect
  function step40(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var desc1 = new ActionDescriptor();
    var ref1 = new ActionReference();
    ref1.putName(PSClass.Channel, "Lights+");
    desc1.putReference(PSString.Null, ref1);
    var ref2 = new ActionReference();
    ref2.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSKey.With, ref2);
    executeAction(PSEvent.Intersect, desc1, dialogMode);
  };

  // Make
  function step41(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var desc1 = new ActionDescriptor();
    var desc2 = new ActionDescriptor();
    desc2.putString(PSKey.Name, "Lights++");
    desc2.putEnumerated(PSKey.ColorIndicates, PSType.MaskIndicator, PSEnum.MaskedAreas);
    var desc3 = new ActionDescriptor();
    desc3.putDouble(PSKey.Red, 255);
    desc3.putDouble(PSKey.Green, 0);
    desc3.putDouble(PSKey.Blue, 0);
    desc2.putObject(PSClass.Color, PSClass.RGBColor, desc3);
    desc2.putInteger(PSKey.Opacity, 50);
    desc1.putObject(PSKey.New, PSClass.Channel, desc2);
    var ref1 = new ActionReference();
    ref1.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSKey.Using, ref1);
    executeAction(PSEvent.Make, desc1, dialogMode);
  };

  // Set
  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.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSString.Null, ref1);
    desc1.putEnumerated(PSKey.To, PSType.Ordinal, PSEnum.None);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

  // Set
  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.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSString.Null, ref1);
    var ref2 = new ActionReference();
    ref2.putName(PSClass.Channel, "Lights++");
    desc1.putReference(PSKey.To, ref2);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

  // Make
  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.putClass(PSClass.AdjustmentLayer);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    desc2.putString(PSKey.Name, "Light Lights");
    desc2.putUnitDouble(PSKey.Opacity, PSUnit.Percent, 60);
    desc2.putEnumerated(PSKey.Mode, PSType.BlendMode, PSEnum.Screen);
    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);
  };

  // Set
  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.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSString.Null, ref1);
    var ref2 = new ActionReference();
    ref2.putName(PSClass.Channel, "Lights+");
    desc1.putReference(PSKey.To, ref2);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

  // Make
  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.putClass(PSClass.AdjustmentLayer);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    desc2.putString(PSKey.Name, "Lights HDR");
    desc2.putEnumerated(PSKey.Mode, PSType.BlendMode, PSEnum.Multiply);
    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);
  };

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

  // Select
  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, "Dark Darks");
    desc1.putReference(PSString.Null, ref1);
    desc1.putEnumerated(PSString.selectionModifier, PSString.selectionModifierType, PSString.addToSelectionContinuous);
    desc1.putBoolean(PSKey.MakeVisible, false);
    executeAction(PSEvent.Select, 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(PSString.layerGroup);
    desc1.putReference(PSString.Null, ref1);
    var ref2 = new ActionReference();
    ref2.putEnumerated(PSClass.Layer, PSType.Ordinal, PSEnum.Target);
    desc1.putReference(PSKey.From, ref2);
    var desc2 = new ActionDescriptor();
    desc2.putString(PSKey.Name, "HDR");
    desc1.putObject(PSKey.Using, PSString.layerGroup, desc2);
    executeAction(PSEvent.Make, desc1, dialogMode);
  };

  // Delete
  function step50(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var desc1 = new ActionDescriptor();
    var ref1 = new ActionReference();
    ref1.putName(PSClass.Channel, "Darks-");
    desc1.putReference(PSString.Null, ref1);
    executeAction(PSEvent.Delete, desc1, dialogMode);
  };

  // Delete
  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.putName(PSClass.Channel, "Darks--");
    desc1.putReference(PSString.Null, ref1);
    executeAction(PSEvent.Delete, desc1, dialogMode);
  };

  // Delete
  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.Channel, "Darks---");
    desc1.putReference(PSString.Null, ref1);
    executeAction(PSEvent.Delete, desc1, dialogMode);
  };

  // Delete
  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.putName(PSClass.Channel, "Lights");
    desc1.putReference(PSString.Null, ref1);
    executeAction(PSEvent.Delete, desc1, dialogMode);
  };

  // Delete
  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.Channel, "Lights+");
    desc1.putReference(PSString.Null, ref1);
    executeAction(PSEvent.Delete, desc1, dialogMode);
  };

  // Delete
  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.putName(PSClass.Channel, "Lights++");
    desc1.putReference(PSString.Null, ref1);
    executeAction(PSEvent.Delete, desc1, dialogMode);
  };

  // Delete
  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.putName(PSClass.Channel, "Darks");
    desc1.putReference(PSString.Null, ref1);
    executeAction(PSEvent.Delete, desc1, dialogMode);
  };

  // Set
  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.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSString.Null, ref1);
    desc1.putEnumerated(PSKey.To, PSType.Ordinal, PSEnum.All);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

  // Subtract
  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);
    var ref2 = new ActionReference();
    ref2.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSKey.From, ref2);
    executeAction(PSEvent.Subtract, desc1, dialogMode);
  };

  // Make
  function step59(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var desc1 = new ActionDescriptor();
    var desc2 = new ActionDescriptor();
    desc2.putString(PSKey.Name, "Temp");
    desc2.putEnumerated(PSKey.ColorIndicates, PSType.MaskIndicator, PSEnum.MaskedAreas);
    var desc3 = new ActionDescriptor();
    desc3.putDouble(PSKey.Red, 255);
    desc3.putDouble(PSKey.Green, 0);
    desc3.putDouble(PSKey.Blue, 0);
    desc2.putObject(PSClass.Color, PSClass.RGBColor, desc3);
    desc2.putInteger(PSKey.Opacity, 50);
    desc1.putObject(PSKey.New, PSClass.Channel, desc2);
    var ref1 = new ActionReference();
    ref1.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSKey.Using, ref1);
    executeAction(PSEvent.Make, desc1, dialogMode);
  };

  // Set
  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.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSString.Null, ref1);
    desc1.putEnumerated(PSKey.To, PSType.Ordinal, PSEnum.None);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

  // Set
  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.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSString.Null, ref1);
    desc1.putEnumerated(PSKey.To, PSType.Ordinal, PSEnum.All);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

  // Subtract
  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.Channel, PSClass.Channel, PSEnum.RGB);
    desc1.putReference(PSString.Null, ref1);
    var ref2 = new ActionReference();
    ref2.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSKey.From, ref2);
    executeAction(PSEvent.Subtract, desc1, dialogMode);
  };

  // Subtract
  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.putName(PSClass.Channel, "Temp");
    desc1.putReference(PSString.Null, ref1);
    var ref2 = new ActionReference();
    ref2.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSKey.From, ref2);
    executeAction(PSEvent.Subtract, desc1, dialogMode);
  };

  // Make
  function step64(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);
  };

  // Set
  function step65(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, 0);
    desc4.putDouble(PSKey.Vertical, 0);
    list2.putObject(PSClass.Point, desc4);
    var desc5 = new ActionDescriptor();
    desc5.putDouble(PSKey.Horizontal, 64);
    desc5.putDouble(PSKey.Vertical, 30);
    list2.putObject(PSClass.Point, desc5);
    var desc6 = new ActionDescriptor();
    desc6.putDouble(PSKey.Horizontal, 128);
    desc6.putDouble(PSKey.Vertical, 128);
    list2.putObject(PSClass.Point, desc6);
    var desc7 = new ActionDescriptor();
    desc7.putDouble(PSKey.Horizontal, 192);
    desc7.putDouble(PSKey.Vertical, 224);
    list2.putObject(PSClass.Point, desc7);
    var desc8 = new ActionDescriptor();
    desc8.putDouble(PSKey.Horizontal, 255);
    desc8.putDouble(PSKey.Vertical, 255);
    list2.putObject(PSClass.Point, desc8);
    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);
  };

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

  // Make
  function step67(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.putString(PSKey.Name, "Auto Contrast");
    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);
  };

  // Set
  function step68(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);
    desc3.putBoolean(sTID("autoMachineLearning"), true);
    desc3.putBoolean(sTID("autoFaces"), true);
    list1.putObject(PSClass.CurvesAdjustment, desc3);
    desc2.putList(PSKey.Adjustment, list1);
    desc1.putObject(PSKey.To, PSClass.Curves, desc2);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

  // Select
  function step69(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);
  };

  // Delete
  function step70(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);
  };

  // Make
  function step71(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);
    ref1.putName(PSClass.Layer, "Auto Contrast");
    desc1.putReference(PSKey.At, ref1);
    var ref2 = new ActionReference();
    ref2.putEnumerated(PSClass.Channel, PSClass.Channel, PSClass.Mask);
    ref2.putName(PSClass.Layer, "Contrast");
    desc1.putReference(PSKey.Using, ref2);
    desc1.putBoolean(PSKey.Duplicate, true);
    executeAction(PSEvent.Make, desc1, dialogMode);
  };

  // Hide
  function step72(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.putName(PSClass.Layer, "Contrast");
    list1.putReference(ref1);
    desc1.putList(PSString.Null, list1);
    executeAction(PSEvent.Hide, desc1, dialogMode);
  };

  // Hide
  function step73(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.putName(PSClass.Layer, "HDR");
    list1.putReference(ref1);
    desc1.putList(PSString.Null, list1);
    executeAction(PSEvent.Hide, desc1, dialogMode);
  };

  // Hide
  function step74(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);
  };

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

  // Make
  function step76(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, "map");
    desc2.putUnitDouble(PSKey.Opacity, PSUnit.Percent, 50);
    desc2.putEnumerated(PSKey.Mode, PSType.BlendMode, PSString.linearLight);
    desc1.putObject(PSKey.Using, PSClass.Layer, desc2);
    executeAction(PSEvent.Make, desc1, dialogMode);
  };

  // Apply Image
  function step77(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);
    desc2.putBoolean(PSEvent.Invert, true);
    desc1.putObject(PSKey.With, PSClass.Calculation, desc2);
    executeAction(sTID('applyImageEvent'), desc1, dialogMode);
  };

  // Surface Blur
  function step78(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var desc1 = new ActionDescriptor();
    desc1.putUnitDouble(PSKey.Radius, PSUnit.Pixels, 30);
    desc1.putInteger(PSKey.Threshold, 30);
    executeAction(sTID('surfaceBlur'), desc1, dialogMode);
  };

  // Make
  function step79(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, "Large Contrast");
    desc2.putEnumerated(PSKey.Mode, PSType.BlendMode, PSEnum.SoftLight);
    desc1.putObject(PSKey.Using, PSClass.Layer, desc2);
    executeAction(PSEvent.Make, desc1, dialogMode);
  };

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

  // Delete
  function step81(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, "map");
    desc1.putReference(PSString.Null, ref1);
    executeAction(PSEvent.Delete, desc1, dialogMode);
  };

  // Reduce Noise
  function step82(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var desc1 = new ActionDescriptor();
    desc1.putUnitDouble(PSEnum.ColorNoise, PSUnit.Percent, 0);
    desc1.putUnitDouble(PSKey.Sharpness, PSUnit.Percent, 0);
    desc1.putBoolean(PSString.removeJPEGArtifact, false);
    var list1 = new ActionList();
    var desc2 = new ActionDescriptor();
    var ref1 = new ActionReference();
    ref1.putEnumerated(PSClass.Channel, PSClass.Channel, PSEnum.Composite);
    desc2.putReference(PSClass.Channel, ref1);
    desc2.putInteger(PSKey.Amount, 10);
    desc2.putInteger(PSKey.EdgeFidelity, 0);
    list1.putObject(PSString.channelDenoiseParams, desc2);
    var desc3 = new ActionDescriptor();
    var ref2 = new ActionReference();
    ref2.putEnumerated(PSClass.Channel, PSClass.Channel, PSKey.Red);
    desc3.putReference(PSClass.Channel, ref2);
    desc3.putInteger(PSKey.Amount, 0);
    list1.putObject(PSString.channelDenoiseParams, desc3);
    var desc4 = new ActionDescriptor();
    var ref3 = new ActionReference();
    ref3.putEnumerated(PSClass.Channel, PSClass.Channel, PSKey.Green);
    desc4.putReference(PSClass.Channel, ref3);
    desc4.putInteger(PSKey.Amount, 0);
    list1.putObject(PSString.channelDenoiseParams, desc4);
    var desc5 = new ActionDescriptor();
    var ref4 = new ActionReference();
    ref4.putEnumerated(PSClass.Channel, PSClass.Channel, PSKey.Blue);
    desc5.putReference(PSClass.Channel, ref4);
    desc5.putInteger(PSKey.Amount, 0);
    list1.putObject(PSString.channelDenoiseParams, desc5);
    desc1.putList(PSString.channelDenoise, list1);
    desc1.putString(PSString.preset, "По умолчанию");
    executeAction(sTID('denoise'), desc1, dialogMode);
  };

  // Reduce Noise
  function step83(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var desc1 = new ActionDescriptor();
    desc1.putUnitDouble(PSEnum.ColorNoise, PSUnit.Percent, 0);
    desc1.putUnitDouble(PSKey.Sharpness, PSUnit.Percent, 0);
    desc1.putBoolean(PSString.removeJPEGArtifact, false);
    var list1 = new ActionList();
    var desc2 = new ActionDescriptor();
    var ref1 = new ActionReference();
    ref1.putEnumerated(PSClass.Channel, PSClass.Channel, PSEnum.Composite);
    desc2.putReference(PSClass.Channel, ref1);
    desc2.putInteger(PSKey.Amount, 10);
    desc2.putInteger(PSKey.EdgeFidelity, 0);
    list1.putObject(PSString.channelDenoiseParams, desc2);
    var desc3 = new ActionDescriptor();
    var ref2 = new ActionReference();
    ref2.putEnumerated(PSClass.Channel, PSClass.Channel, PSKey.Red);
    desc3.putReference(PSClass.Channel, ref2);
    desc3.putInteger(PSKey.Amount, 0);
    list1.putObject(PSString.channelDenoiseParams, desc3);
    var desc4 = new ActionDescriptor();
    var ref3 = new ActionReference();
    ref3.putEnumerated(PSClass.Channel, PSClass.Channel, PSKey.Green);
    desc4.putReference(PSClass.Channel, ref3);
    desc4.putInteger(PSKey.Amount, 0);
    list1.putObject(PSString.channelDenoiseParams, desc4);
    var desc5 = new ActionDescriptor();
    var ref4 = new ActionReference();
    ref4.putEnumerated(PSClass.Channel, PSClass.Channel, PSKey.Blue);
    desc5.putReference(PSClass.Channel, ref4);
    desc5.putInteger(PSKey.Amount, 0);
    list1.putObject(PSString.channelDenoiseParams, desc5);
    desc1.putList(PSString.channelDenoise, list1);
    desc1.putString(PSString.preset, "По умолчанию");
    executeAction(sTID('denoise'), desc1, dialogMode);
  };

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

  // Make
  function step85(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, "map");
    desc2.putUnitDouble(PSKey.Opacity, PSUnit.Percent, 50);
    desc2.putEnumerated(PSKey.Mode, PSType.BlendMode, PSString.linearLight);
    desc1.putObject(PSKey.Using, PSClass.Layer, desc2);
    executeAction(PSEvent.Make, desc1, dialogMode);
  };

  // Apply Image
  function step86(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);
    desc2.putBoolean(PSEvent.Invert, true);
    desc1.putObject(PSKey.With, PSClass.Calculation, desc2);
    executeAction(sTID('applyImageEvent'), desc1, dialogMode);
  };

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

  // Make
  function step88(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, "Medium Contrast");
    desc2.putEnumerated(PSKey.Mode, PSType.BlendMode, PSEnum.SoftLight);
    desc1.putObject(PSKey.Using, PSClass.Layer, desc2);
    executeAction(PSEvent.Make, desc1, dialogMode);
  };

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

  // Delete
  function step90(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, "map");
    desc1.putReference(PSString.Null, ref1);
    executeAction(PSEvent.Delete, desc1, dialogMode);
  };

  // Reduce Noise
  function step91(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var desc1 = new ActionDescriptor();
    desc1.putUnitDouble(PSEnum.ColorNoise, PSUnit.Percent, 0);
    desc1.putUnitDouble(PSKey.Sharpness, PSUnit.Percent, 0);
    desc1.putBoolean(PSString.removeJPEGArtifact, false);
    var list1 = new ActionList();
    var desc2 = new ActionDescriptor();
    var ref1 = new ActionReference();
    ref1.putEnumerated(PSClass.Channel, PSClass.Channel, PSEnum.Composite);
    desc2.putReference(PSClass.Channel, ref1);
    desc2.putInteger(PSKey.Amount, 10);
    desc2.putInteger(PSKey.EdgeFidelity, 0);
    list1.putObject(PSString.channelDenoiseParams, desc2);
    var desc3 = new ActionDescriptor();
    var ref2 = new ActionReference();
    ref2.putEnumerated(PSClass.Channel, PSClass.Channel, PSKey.Red);
    desc3.putReference(PSClass.Channel, ref2);
    desc3.putInteger(PSKey.Amount, 0);
    list1.putObject(PSString.channelDenoiseParams, desc3);
    var desc4 = new ActionDescriptor();
    var ref3 = new ActionReference();
    ref3.putEnumerated(PSClass.Channel, PSClass.Channel, PSKey.Green);
    desc4.putReference(PSClass.Channel, ref3);
    desc4.putInteger(PSKey.Amount, 0);
    list1.putObject(PSString.channelDenoiseParams, desc4);
    var desc5 = new ActionDescriptor();
    var ref4 = new ActionReference();
    ref4.putEnumerated(PSClass.Channel, PSClass.Channel, PSKey.Blue);
    desc5.putReference(PSClass.Channel, ref4);
    desc5.putInteger(PSKey.Amount, 0);
    list1.putObject(PSString.channelDenoiseParams, desc5);
    desc1.putList(PSString.channelDenoise, list1);
    desc1.putString(PSString.preset, "По умолчанию");
    executeAction(sTID('denoise'), desc1, dialogMode);
  };

  // Reduce Noise
  function step92(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var desc1 = new ActionDescriptor();
    desc1.putUnitDouble(PSEnum.ColorNoise, PSUnit.Percent, 0);
    desc1.putUnitDouble(PSKey.Sharpness, PSUnit.Percent, 0);
    desc1.putBoolean(PSString.removeJPEGArtifact, false);
    var list1 = new ActionList();
    var desc2 = new ActionDescriptor();
    var ref1 = new ActionReference();
    ref1.putEnumerated(PSClass.Channel, PSClass.Channel, PSEnum.Composite);
    desc2.putReference(PSClass.Channel, ref1);
    desc2.putInteger(PSKey.Amount, 10);
    desc2.putInteger(PSKey.EdgeFidelity, 0);
    list1.putObject(PSString.channelDenoiseParams, desc2);
    var desc3 = new ActionDescriptor();
    var ref2 = new ActionReference();
    ref2.putEnumerated(PSClass.Channel, PSClass.Channel, PSKey.Red);
    desc3.putReference(PSClass.Channel, ref2);
    desc3.putInteger(PSKey.Amount, 0);
    list1.putObject(PSString.channelDenoiseParams, desc3);
    var desc4 = new ActionDescriptor();
    var ref3 = new ActionReference();
    ref3.putEnumerated(PSClass.Channel, PSClass.Channel, PSKey.Green);
    desc4.putReference(PSClass.Channel, ref3);
    desc4.putInteger(PSKey.Amount, 0);
    list1.putObject(PSString.channelDenoiseParams, desc4);
    var desc5 = new ActionDescriptor();
    var ref4 = new ActionReference();
    ref4.putEnumerated(PSClass.Channel, PSClass.Channel, PSKey.Blue);
    desc5.putReference(PSClass.Channel, ref4);
    desc5.putInteger(PSKey.Amount, 0);
    list1.putObject(PSString.channelDenoiseParams, desc5);
    desc1.putList(PSString.channelDenoise, list1);
    desc1.putString(PSString.preset, "По умолчанию");
    executeAction(sTID('denoise'), desc1, dialogMode);
  };

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

  // Make
  function step94(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, "map");
    desc2.putUnitDouble(PSKey.Opacity, PSUnit.Percent, 50);
    desc2.putEnumerated(PSKey.Mode, PSType.BlendMode, PSString.linearLight);
    desc1.putObject(PSKey.Using, PSClass.Layer, desc2);
    executeAction(PSEvent.Make, desc1, dialogMode);
  };

  // Apply Image
  function step95(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);
    desc2.putBoolean(PSEvent.Invert, true);
    desc1.putObject(PSKey.With, PSClass.Calculation, desc2);
    executeAction(sTID('applyImageEvent'), desc1, dialogMode);
  };

  // Surface Blur
  function step96(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);
    desc1.putInteger(PSKey.Threshold, 15);
    executeAction(sTID('surfaceBlur'), desc1, dialogMode);
  };

  // Make
  function step97(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, "Small Contrast");
    desc2.putEnumerated(PSKey.Mode, PSType.BlendMode, PSEnum.SoftLight);
    desc1.putObject(PSKey.Using, PSClass.Layer, desc2);
    executeAction(PSEvent.Make, desc1, dialogMode);
  };

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

  // Delete
  function step99(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, "map");
    desc1.putReference(PSString.Null, ref1);
    executeAction(PSEvent.Delete, desc1, dialogMode);
  };

  // Reduce Noise
  function step100(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var desc1 = new ActionDescriptor();
    desc1.putUnitDouble(PSEnum.ColorNoise, PSUnit.Percent, 0);
    desc1.putUnitDouble(PSKey.Sharpness, PSUnit.Percent, 0);
    desc1.putBoolean(PSString.removeJPEGArtifact, false);
    var list1 = new ActionList();
    var desc2 = new ActionDescriptor();
    var ref1 = new ActionReference();
    ref1.putEnumerated(PSClass.Channel, PSClass.Channel, PSEnum.Composite);
    desc2.putReference(PSClass.Channel, ref1);
    desc2.putInteger(PSKey.Amount, 10);
    desc2.putInteger(PSKey.EdgeFidelity, 0);
    list1.putObject(PSString.channelDenoiseParams, desc2);
    var desc3 = new ActionDescriptor();
    var ref2 = new ActionReference();
    ref2.putEnumerated(PSClass.Channel, PSClass.Channel, PSKey.Red);
    desc3.putReference(PSClass.Channel, ref2);
    desc3.putInteger(PSKey.Amount, 0);
    list1.putObject(PSString.channelDenoiseParams, desc3);
    var desc4 = new ActionDescriptor();
    var ref3 = new ActionReference();
    ref3.putEnumerated(PSClass.Channel, PSClass.Channel, PSKey.Green);
    desc4.putReference(PSClass.Channel, ref3);
    desc4.putInteger(PSKey.Amount, 0);
    list1.putObject(PSString.channelDenoiseParams, desc4);
    var desc5 = new ActionDescriptor();
    var ref4 = new ActionReference();
    ref4.putEnumerated(PSClass.Channel, PSClass.Channel, PSKey.Blue);
    desc5.putReference(PSClass.Channel, ref4);
    desc5.putInteger(PSKey.Amount, 0);
    list1.putObject(PSString.channelDenoiseParams, desc5);
    desc1.putList(PSString.channelDenoise, list1);
    desc1.putString(PSString.preset, "По умолчанию");
    executeAction(sTID('denoise'), desc1, dialogMode);
  };

  // Reduce Noise
  function step101(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var desc1 = new ActionDescriptor();
    desc1.putUnitDouble(PSEnum.ColorNoise, PSUnit.Percent, 0);
    desc1.putUnitDouble(PSKey.Sharpness, PSUnit.Percent, 0);
    desc1.putBoolean(PSString.removeJPEGArtifact, false);
    var list1 = new ActionList();
    var desc2 = new ActionDescriptor();
    var ref1 = new ActionReference();
    ref1.putEnumerated(PSClass.Channel, PSClass.Channel, PSEnum.Composite);
    desc2.putReference(PSClass.Channel, ref1);
    desc2.putInteger(PSKey.Amount, 10);
    desc2.putInteger(PSKey.EdgeFidelity, 0);
    list1.putObject(PSString.channelDenoiseParams, desc2);
    var desc3 = new ActionDescriptor();
    var ref2 = new ActionReference();
    ref2.putEnumerated(PSClass.Channel, PSClass.Channel, PSKey.Red);
    desc3.putReference(PSClass.Channel, ref2);
    desc3.putInteger(PSKey.Amount, 0);
    list1.putObject(PSString.channelDenoiseParams, desc3);
    var desc4 = new ActionDescriptor();
    var ref3 = new ActionReference();
    ref3.putEnumerated(PSClass.Channel, PSClass.Channel, PSKey.Green);
    desc4.putReference(PSClass.Channel, ref3);
    desc4.putInteger(PSKey.Amount, 0);
    list1.putObject(PSString.channelDenoiseParams, desc4);
    var desc5 = new ActionDescriptor();
    var ref4 = new ActionReference();
    ref4.putEnumerated(PSClass.Channel, PSClass.Channel, PSKey.Blue);
    desc5.putReference(PSClass.Channel, ref4);
    desc5.putInteger(PSKey.Amount, 0);
    list1.putObject(PSString.channelDenoiseParams, desc5);
    desc1.putList(PSString.channelDenoise, list1);
    desc1.putString(PSString.preset, "По умолчанию");
    executeAction(sTID('denoise'), desc1, dialogMode);
  };

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

  // Make
  function step103(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);
    var desc2 = new ActionDescriptor();
    desc2.putString(PSKey.Name, "Group Local Contrast");
    desc1.putObject(PSKey.Using, PSString.layerGroup, desc2);
    executeAction(PSEvent.Make, desc1, dialogMode);
  };

  // Hide
  function step104(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);
  };

  // Make
  function step105(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, "_Temp");
    desc1.putObject(PSKey.Using, PSClass.Layer, desc2);
    executeAction(PSEvent.Make, desc1, dialogMode);
  };

  // Move
  function step106(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 ref2 = new ActionReference();
    ref2.putEnumerated(PSClass.Layer, PSType.Ordinal, PSEnum.Front);
    desc1.putReference(PSKey.To, ref2);
    executeAction(PSEvent.Move, desc1, dialogMode);
  };

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

  // Convert to Smart Object
  function step108(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    executeAction(sTID('newPlacedLayer'), undefined, dialogMode);
  };

  // Edit Contents
  function step109(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var desc1 = new ActionDescriptor();
    executeAction(sTID('placedLayerEditContents'), desc1, dialogMode);
  };

  // Convert Mode
  function step110(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var desc1 = new ActionDescriptor();
    desc1.putClass(PSKey.To, PSClass.LabColorMode);
    executeAction(sTID('convertMode'), desc1, dialogMode);
  };

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

  // Set
  function step112(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.All);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

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

  // Close
  function step114(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var desc1 = new ActionDescriptor();
    var desc2 = new ActionDescriptor();
    desc2.putBoolean(PSString.maximizeCompatibility, false);
    desc1.putObject(PSKey.As, PSString.largeDocumentFormat, desc2);
    desc1.putPath(PSKey.In, new File("~/AppData/Local/Temp"));
    desc1.putInteger(PSKey.DocumentID, 414);
    desc1.putEnumerated(PSKey.Saving, PSType.YesNo, PSEnum.Yes);
    executeAction(PSEvent.Close, desc1, dialogMode);
  };

  // Update Smart Objects
  function step115(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    executeAction(sTID('updatePlacedLayer'), undefined, dialogMode);
  };

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

  // Make
  function step117(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, "Black");
    desc1.putObject(PSKey.Using, PSClass.Layer, desc2);
    executeAction(PSEvent.Make, desc1, dialogMode);
  };

  // Paste
  function step118(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var desc1 = new ActionDescriptor();
    desc1.putEnumerated(PSKey.AntiAlias, PSType.AntiAlias, PSEnum.AntiAliasNone);
    executeAction(PSEvent.Paste, desc1, dialogMode);
  };

  // Make
  function step119(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var desc1 = new ActionDescriptor();
    var desc2 = new ActionDescriptor();
    desc2.putString(PSKey.Name, "Black Blur");
    desc1.putObject(PSKey.New, PSClass.Layer, desc2);
    desc1.putEnumerated(PSKey.Using, PSType.AreaSelector, PSEnum.Selection);
    desc1.putBoolean(PSKey.Copy, true);
    executeAction(PSEvent.Make, desc1, dialogMode);
  };

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

  // Move
  function step121(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 ref2 = new ActionReference();
    ref2.putEnumerated(PSClass.Layer, PSType.Ordinal, PSEnum.Previous);
    desc1.putReference(PSKey.To, ref2);
    executeAction(PSEvent.Move, desc1, dialogMode);
  };

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

  // Apply Image
  function step123(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, "Black Blur");
    desc2.putReference(PSKey.To, ref1);
    desc2.putEnumerated(PSClass.Calculation, PSType.Calculation, PSEvent.Subtract);
    desc2.putDouble(PSKey.Scale, 2);
    desc2.putInteger(PSKey.Offset, 128);
    desc1.putObject(PSKey.With, PSClass.Calculation, desc2);
    executeAction(sTID('applyImageEvent'), desc1, dialogMode);
  };

  // Delete
  function step124(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, "Black Blur");
    desc1.putReference(PSString.Null, ref1);
    executeAction(PSEvent.Delete, desc1, dialogMode);
  };

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

  // Make
  function step126(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.putString(PSKey.Name, "ajust");
    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);
  };

  // Create Clipping Mask
  function step127(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);
  };

  // Set
  function step128(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, 0);
    desc4.putDouble(PSKey.Vertical, 80);
    list2.putObject(PSClass.Point, desc4);
    var desc5 = new ActionDescriptor();
    desc5.putDouble(PSKey.Horizontal, 81);
    desc5.putDouble(PSKey.Vertical, 98);
    list2.putObject(PSClass.Point, desc5);
    var desc6 = new ActionDescriptor();
    desc6.putDouble(PSKey.Horizontal, 128);
    desc6.putDouble(PSKey.Vertical, 128);
    list2.putObject(PSClass.Point, desc6);
    var desc7 = new ActionDescriptor();
    desc7.putDouble(PSKey.Horizontal, 185);
    desc7.putDouble(PSKey.Vertical, 255);
    list2.putObject(PSClass.Point, desc7);
    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);
  };

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

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

  // Select
  function step131(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.Forward);
    desc1.putReference(PSString.Null, ref1);
    desc1.putEnumerated(PSString.selectionModifier, PSString.selectionModifierType, PSString.addToSelection);
    desc1.putBoolean(PSKey.MakeVisible, false);
    executeAction(PSEvent.Select, desc1, dialogMode);
  };

  // Make
  function step132(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);
    var desc2 = new ActionDescriptor();
    desc2.putString(PSKey.Name, "Clarity");
    desc1.putObject(PSKey.Using, PSString.layerGroup, desc2);
    executeAction(PSEvent.Make, desc1, dialogMode);
  };

  // Hide
  function step133(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);
  };

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

  // Make
  function step135(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, "map");
    desc2.putUnitDouble(PSKey.Opacity, PSUnit.Percent, 50);
    desc2.putEnumerated(PSKey.Mode, PSType.BlendMode, PSString.linearLight);
    desc1.putObject(PSKey.Using, PSClass.Layer, desc2);
    executeAction(PSEvent.Make, desc1, dialogMode);
  };

  // Apply Image
  function step136(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);
    desc2.putBoolean(PSEvent.Invert, true);
    desc1.putObject(PSKey.With, PSClass.Calculation, desc2);
    executeAction(sTID('applyImageEvent'), desc1, dialogMode);
  };

  // Surface Blur
  function step137(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var desc1 = new ActionDescriptor();
    desc1.putUnitDouble(PSKey.Radius, PSUnit.Pixels, 4);
    desc1.putInteger(PSKey.Threshold, 8);
    executeAction(sTID('surfaceBlur'), desc1, dialogMode);
  };

  // Make
  function step138(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, "Large Sharp");
    desc2.putEnumerated(PSKey.Mode, PSType.BlendMode, PSEnum.SoftLight);
    desc1.putObject(PSKey.Using, PSClass.Layer, desc2);
    executeAction(PSEvent.Make, desc1, dialogMode);
  };

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

  // Delete
  function step140(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, "map");
    desc1.putReference(PSString.Null, ref1);
    executeAction(PSEvent.Delete, desc1, dialogMode);
  };

  // Hide
  function step141(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);
  };

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

  // Make
  function step143(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, "map");
    desc2.putUnitDouble(PSKey.Opacity, PSUnit.Percent, 50);
    desc2.putEnumerated(PSKey.Mode, PSType.BlendMode, PSString.linearLight);
    desc1.putObject(PSKey.Using, PSClass.Layer, desc2);
    executeAction(PSEvent.Make, desc1, dialogMode);
  };

  // Apply Image
  function step144(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);
    desc2.putBoolean(PSEvent.Invert, true);
    desc1.putObject(PSKey.With, PSClass.Calculation, desc2);
    executeAction(sTID('applyImageEvent'), desc1, dialogMode);
  };

  // Surface Blur
  function step145(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var desc1 = new ActionDescriptor();
    desc1.putUnitDouble(PSKey.Radius, PSUnit.Pixels, 2);
    desc1.putInteger(PSKey.Threshold, 8);
    executeAction(sTID('surfaceBlur'), desc1, dialogMode);
  };

  // Make
  function step146(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, "Medium Sharp");
    desc2.putEnumerated(PSKey.Mode, PSType.BlendMode, PSEnum.Overlay);
    desc1.putObject(PSKey.Using, PSClass.Layer, desc2);
    executeAction(PSEvent.Make, desc1, dialogMode);
  };

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

  // Delete
  function step148(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, "map");
    desc1.putReference(PSString.Null, ref1);
    executeAction(PSEvent.Delete, desc1, dialogMode);
  };

  // Hide
  function step149(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);
  };

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

  // Make
  function step151(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, "Small Sharp");
    desc2.putEnumerated(PSKey.Mode, PSType.BlendMode, PSEnum.Overlay);
    desc1.putObject(PSKey.Using, PSClass.Layer, desc2);
    executeAction(PSEvent.Make, desc1, dialogMode);
  };

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

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

  // Hide
  function step154(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);
  };

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

  // Make
  function step156(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, "Super Small Sharp");
    desc2.putEnumerated(PSKey.Mode, PSType.BlendMode, PSEnum.Overlay);
    desc1.putObject(PSKey.Using, PSClass.Layer, desc2);
    executeAction(PSEvent.Make, desc1, dialogMode);
  };

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

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

  // Show
  function step159(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.putName(PSClass.Layer, "Small Sharp");
    list1.putReference(ref1);
    desc1.putList(PSString.Null, list1);
    executeAction(PSEvent.Show, desc1, dialogMode);
  };

  // Show
  function step160(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.putName(PSClass.Layer, "Medium Sharp");
    list1.putReference(ref1);
    desc1.putList(PSString.Null, list1);
    executeAction(PSEvent.Show, desc1, dialogMode);
  };

  // Show
  function step161(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.putName(PSClass.Layer, "Large Sharp");
    list1.putReference(ref1);
    desc1.putList(PSString.Null, list1);
    executeAction(PSEvent.Show, desc1, dialogMode);
  };

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

  // Make
  function step163(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);
    var desc2 = new ActionDescriptor();
    desc2.putString(PSKey.Name, "Group Sharp");
    desc1.putObject(PSKey.Using, PSString.layerGroup, desc2);
    executeAction(PSEvent.Make, desc1, dialogMode);
  };

  // Show
  function step164(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.putName(PSClass.Layer, "Clarity");
    list1.putReference(ref1);
    desc1.putList(PSString.Null, list1);
    executeAction(PSEvent.Show, desc1, dialogMode);
  };

  // Show
  function step165(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.putName(PSClass.Layer, "Group Local Contrast");
    list1.putReference(ref1);
    desc1.putList(PSString.Null, list1);
    executeAction(PSEvent.Show, desc1, dialogMode);
  };

  // Show
  function step166(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.putName(PSClass.Layer, "Auto Contrast");
    list1.putReference(ref1);
    desc1.putList(PSString.Null, list1);
    executeAction(PSEvent.Show, desc1, dialogMode);
  };

  // Show
  function step167(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.putName(PSClass.Layer, "Contrast");
    list1.putReference(ref1);
    desc1.putList(PSString.Null, list1);
    executeAction(PSEvent.Show, desc1, dialogMode);
  };

  // Show
  function step168(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.putName(PSClass.Layer, "HDR");
    list1.putReference(ref1);
    desc1.putList(PSString.Null, list1);
    executeAction(PSEvent.Show, desc1, dialogMode);
  };

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

  // Move
  function step170(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 ref2 = new ActionReference();
    ref2.putEnumerated(PSClass.Layer, PSType.Ordinal, PSEnum.Front);
    desc1.putReference(PSKey.To, ref2);
    executeAction(PSEvent.Move, desc1, dialogMode);
  };

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

  // Move
  function step172(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 ref2 = new ActionReference();
    ref2.putEnumerated(PSClass.Layer, PSType.Ordinal, PSEnum.Front);
    desc1.putReference(PSKey.To, ref2);
    executeAction(PSEvent.Move, desc1, dialogMode);
  };

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

  // Move
  function step174(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 ref2 = new ActionReference();
    ref2.putEnumerated(PSClass.Layer, PSType.Ordinal, PSEnum.Front);
    desc1.putReference(PSKey.To, ref2);
    executeAction(PSEvent.Move, desc1, dialogMode);
  };

  // Move
  function step175(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 ref2 = new ActionReference();
    ref2.putEnumerated(PSClass.Layer, PSType.Ordinal, PSEnum.Front);
    desc1.putReference(PSKey.To, ref2);
    executeAction(PSEvent.Move, desc1, dialogMode);
  };

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

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

  // Move
  function step178(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 ref2 = new ActionReference();
    ref2.putEnumerated(PSClass.Layer, PSType.Ordinal, PSEnum.Front);
    desc1.putReference(PSKey.To, ref2);
    executeAction(PSEvent.Move, desc1, dialogMode);
  };

  // Move
  function step179(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 ref2 = new ActionReference();
    ref2.putEnumerated(PSClass.Layer, PSType.Ordinal, PSEnum.Front);
    desc1.putReference(PSKey.To, ref2);
    executeAction(PSEvent.Move, desc1, dialogMode);
  };

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

  // Set
  function step181(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.RGB);
    desc1.putReference(PSKey.To, ref2);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

  // Intersect
  function step182(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);
    var ref2 = new ActionReference();
    ref2.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSKey.With, ref2);
    executeAction(PSEvent.Intersect, desc1, dialogMode);
  };

  // Make
  function step183(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.putString(PSKey.Name, "Punch Lights+");
    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);
  };

  // Set
  function step184(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);
  };

  // Set
  function step185(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.All);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

  // Subtract
  function step186(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);
    var ref2 = new ActionReference();
    ref2.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSKey.From, ref2);
    executeAction(PSEvent.Subtract, desc1, dialogMode);
  };

  // Subtract
  function step187(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);
    var ref2 = new ActionReference();
    ref2.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSKey.From, ref2);
    executeAction(PSEvent.Subtract, desc1, dialogMode);
  };

  // Make
  function step188(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.putString(PSKey.Name, "Punch Blacks+");
    desc2.putEnumerated(PSKey.Mode, PSType.BlendMode, PSEnum.SoftLight);
    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);
  };

  // Hide
  function step189(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.putName(PSClass.Layer, "Punch Lights+");
    list1.putReference(ref1);
    desc1.putList(PSString.Null, list1);
    executeAction(PSEvent.Hide, desc1, dialogMode);
  };

  // Hide
  function step190(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.putName(PSClass.Layer, "Punch Blacks+");
    list1.putReference(ref1);
    desc1.putList(PSString.Null, list1);
    executeAction(PSEvent.Hide, desc1, dialogMode);
  };

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

  // Make
  function step192(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.putString(PSKey.Name, "Low Key");
    var desc3 = new ActionDescriptor();
    desc3.putEnumerated(PSString.presetKind, PSString.presetKindType, PSString.presetKindDefault);
    desc3.putDouble(PSKey.Exposure, 0);
    desc3.putDouble(PSKey.Offset, 0);
    desc3.putDouble(PSString.gammaCorrection, 1);
    desc2.putObject(PSKey.Type, PSKey.Exposure, desc3);
    desc1.putObject(PSKey.Using, PSClass.AdjustmentLayer, desc2);
    executeAction(PSEvent.Make, desc1, dialogMode);
  };

  // Set
  function step193(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);
    desc2.putDouble(PSKey.Exposure, -0.80000001192093);
    desc1.putObject(PSKey.To, PSKey.Exposure, desc2);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

  // Make
  function step194(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.putString(PSKey.Name, "High Key");
    var desc3 = new ActionDescriptor();
    desc3.putEnumerated(PSString.presetKind, PSString.presetKindType, PSString.presetKindDefault);
    desc3.putDouble(PSKey.Exposure, 0);
    desc3.putDouble(PSKey.Offset, 0);
    desc3.putDouble(PSString.gammaCorrection, 1);
    desc2.putObject(PSKey.Type, PSKey.Exposure, desc3);
    desc1.putObject(PSKey.Using, PSClass.AdjustmentLayer, desc2);
    executeAction(PSEvent.Make, desc1, dialogMode);
  };

  // Set
  function step195(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);
    desc2.putDouble(PSKey.Exposure, 0.69999998807907);
    desc1.putObject(PSKey.To, PSKey.Exposure, desc2);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

  // Hide
  function step196(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.putName(PSClass.Layer, "High Key");
    list1.putReference(ref1);
    desc1.putList(PSString.Null, list1);
    executeAction(PSEvent.Hide, desc1, dialogMode);
  };

  // Hide
  function step197(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.putName(PSClass.Layer, "Low Key");
    list1.putReference(ref1);
    desc1.putList(PSString.Null, list1);
    executeAction(PSEvent.Hide, desc1, dialogMode);
  };

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

  // Select
  function step199(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, "Punch Blacks+");
    desc1.putReference(PSString.Null, ref1);
    desc1.putEnumerated(PSString.selectionModifier, PSString.selectionModifierType, PSString.addToSelectionContinuous);
    desc1.putBoolean(PSKey.MakeVisible, false);
    executeAction(PSEvent.Select, desc1, dialogMode);
  };

  // Make
  function step200(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);
  };

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

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

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

  // Make
  function step204(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);
  };

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

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

  // Set
  function step207(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);
  };

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

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

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

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

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

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

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

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

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

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

  step1();      // Make
  step2();      // Merge Visible
  step3();      // Average
  step4();      // Invert
  step5();      // Make
  step6();      // Fill
  step7();      // Make
  step8();      // Fill
  step9();      // Select
  step10();      // Merge Layers
  step11(true, true);      // Set
  step12();      // Set
  step13();      // Subtract
  step14();      // Make
  step15();      // Set
  step16();      // Set
  step17();      // Intersect
  step18();      // Make
  step19();      // Set
  step20();      // Set
  step21();      // Intersect
  step22();      // Make
  step23();      // Set
  step24();      // Set
  step25();      // Intersect
  step26();      // Make
  step27();      // Set
  step28();      // Set
  step29();      // Make
  step30();      // Set
  step31();      // Make
  step32();      // Set
  step33();      // Make
  step34();      // Set
  step35();      // Set
  step36();      // Intersect
  step37();      // Make
  step38();      // Set
  step39();      // Set
  step40();      // Intersect
  step41();      // Make
  step42();      // Set
  step43();      // Set
  step44();      // Make
  step45();      // Set
  step46();      // Make
  step47();      // Select
  step48();      // Select
  step49();      // Make
  step50();      // Delete
  step51();      // Delete
  step52();      // Delete
  step53();      // Delete
  step54();      // Delete
  step55();      // Delete
  step56();      // Delete
  step57();      // Set
  step58();      // Subtract
  step59();      // Make
  step60();      // Set
  step61();      // Set
  step62();      // Subtract
  step63();      // Subtract
  step64();      // Make
  step65();      // Set
  step66();      // Set
  step67();      // Make
  step68();      // Set
  step69();      // Select
  step70();      // Delete
  step71();      // Make
  step72();      // Hide
  step73();      // Hide
  step74();      // Hide
  step75();      // Select
  step76();      // Make
  step77();      // Apply Image
  step78();      // Surface Blur
  step79();      // Make
  step80();      // Apply Image
  step81();      // Delete
  step82();      // Reduce Noise
  step83();      // Reduce Noise
  step84();      // Select
  step85();      // Make
  step86();      // Apply Image
  step87();      // Surface Blur
  step88();      // Make
  step89();      // Apply Image
  step90();      // Delete
  step91();      // Reduce Noise
  step92();      // Reduce Noise
  step93();      // Select
  step94();      // Make
  step95();      // Apply Image
  step96();      // Surface Blur
  step97();      // Make
  step98();      // Apply Image
  step99();      // Delete
  step100();      // Reduce Noise
  step101();      // Reduce Noise
  step102();      // Select
  step103();      // Make
  step104();      // Hide
  step105();      // Make
  step106();      // Move
  step107();      // Apply Image
  step108();      // Convert to Smart Object
  step109();      // Edit Contents
  step110();      // Convert Mode
  step111();      // Select
  step112();      // Set
  step113();      // Copy
  step114();      // Close
  step115();      // Update Smart Objects
  step116();      // Set
  step117();      // Make
  step118();      // Paste
  step119();      // Make
  step120();      // Surface Blur
  step121();      // Move
  step122();      // Select
  step123();      // Apply Image
  step124();      // Delete
  step125();      // Delete
  step126();      // Make
  step127();      // Create Clipping Mask
  step128();      // Set
  step129();      // Select
  step130();      // Set
  step131();      // Select
  step132();      // Make
  step133();      // Hide
  step134();      // Select
  step135();      // Make
  step136();      // Apply Image
  step137();      // Surface Blur
  step138();      // Make
  step139();      // Apply Image
  step140();      // Delete
  step141();      // Hide
  step142();      // Select
  step143();      // Make
  step144();      // Apply Image
  step145();      // Surface Blur
  step146();      // Make
  step147();      // Apply Image
  step148();      // Delete
  step149();      // Hide
  step150();      // Select
  step151();      // Make
  step152();      // Apply Image
  step153();      // High Pass
  step154();      // Hide
  step155();      // Select
  step156();      // Make
  step157();      // Apply Image
  step158();      // High Pass
  step159();      // Show
  step160();      // Show
  step161();      // Show
  step162();      // Select
  step163();      // Make
  step164();      // Show
  step165();      // Show
  step166();      // Show
  step167();      // Show
  step168();      // Show
  step169();      // Select
  step170();      // Move
  step171();      // Select
  step172();      // Move
  step173();      // Select
  step174();      // Move
  step175();      // Move
  step176();      // Set
  step177();      // Select
  step178();      // Move
  step179();      // Move
  step180();      // Set
  step181();      // Set
  step182();      // Intersect
  step183();      // Make
  step184();      // Set
  step185();      // Set
  step186();      // Subtract
  step187();      // Subtract
  step188();      // Make
  step189();      // Hide
  step190();      // Hide
  step191();      // Select
  step192();      // Make
  step193();      // Set
  step194();      // Make
  step195();      // Set
  step196();      // Hide
  step197();      // Hide
  step198();      // Select
  step199();      // Select
  step200();      // Make
  step201();      // Set
  step202();      // Select
  step203();      // Select
  step204();      // Make
  step205();      // Set
  step206();      // Select
  step207();      // Set
  step208();      // Select
  step209();      // Set
  step210();      // Select
  step211();      // Set
  step212();      // Select
  step213();      // Set
  step214();      // Select
  step215();      // Set
  step216();      // Select
  step217();      // Set
};



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

//
// HDRX3.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.
//
HDRX3.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.Color = cTID('Clr ');
  PSClass.Curves = cTID('Crvs');
  PSClass.CurvesAdjustment = cTID('CrvA');
  PSClass.HSBColor = cTID('HSBC');
  PSClass.LabColor = cTID('LbCl');
  PSClass.LabColorMode = cTID('LbCM');
  PSClass.Layer = cTID('Lyr ');
  PSClass.Mask = cTID('Msk ');
  PSClass.Point = cTID('Pnt ');
  PSClass.RGBColor = cTID('RGBC');
  PSEnum.All = cTID('Al  ');
  PSEnum.AntiAliasNone = cTID('Anno');
  PSEnum.ColorNoise = cTID('ClNs');
  PSEnum.Composite = cTID('Cmps');
  PSEnum.Forward = cTID('Frwr');
  PSEnum.Front = cTID('Frnt');
  PSEnum.Gray = cTID('Gry ');
  PSEnum.HardLight = cTID('HrdL');
  PSEnum.Lightness = cTID('Lght');
  PSEnum.Luminosity = cTID('Lmns');
  PSEnum.MaskedAreas = cTID('MskA');
  PSEnum.Merged = cTID('Mrgd');
  PSEnum.Multiply = cTID('Mltp');
  PSEnum.None = cTID('None');
  PSEnum.Normal = cTID('Nrml');
  PSEnum.Overlay = cTID('Ovrl');
  PSEnum.Previous = cTID('Prvs');
  PSEnum.RGB = cTID('RGB ');
  PSEnum.Screen = cTID('Scrn');
  PSEnum.Selection = cTID('Slct');
  PSEnum.SoftLight = cTID('SftL');
  PSEnum.Target = cTID('Trgt');
  PSEnum.YellowColor = cTID('Ylw ');
  PSEnum.Yes = cTID('Ys  ');
  PSEvent.Average = cTID('Avrg');
  PSEvent.Close = cTID('Cls ');
  PSEvent.Copy = cTID('copy');
  PSEvent.Delete = cTID('Dlt ');
  PSEvent.Fill = cTID('Fl  ');
  PSEvent.Hide = cTID('Hd  ');
  PSEvent.Intersect = cTID('Intr');
  PSEvent.Invert = cTID('Invr');
  PSEvent.Make = cTID('Mk  ');
  PSEvent.Move = cTID('move');
  PSEvent.Paste = cTID('past');
  PSEvent.Select = cTID('slct');
  PSEvent.Set = cTID('setd');
  PSEvent.Show = cTID('Shw ');
  PSEvent.Subtract = cTID('Sbtr');
  PSKey.Adjustment = cTID('Adjs');
  PSKey.Amount = cTID('Amnt');
  PSKey.AntiAlias = cTID('AntA');
  PSKey.As = cTID('As  ');
  PSKey.At = cTID('At  ');
  PSKey.Blue = cTID('Bl  ');
  PSKey.Brightness = cTID('Brgh');
  PSKey.ColorIndicates = cTID('ClrI');
  PSKey.Copy = cTID('Cpy ');
  PSKey.Curve = cTID('Crv ');
  PSKey.DocumentID = cTID('DocI');
  PSKey.Duplicate = cTID('Dplc');
  PSKey.EdgeFidelity = cTID('EdgF');
  PSKey.Exposure = cTID('Exps');
  PSKey.From = cTID('From');
  PSKey.Green = cTID('Grn ');
  PSKey.Horizontal = cTID('Hrzn');
  PSKey.Hue = cTID('H   ');
  PSKey.In = cTID('In  ');
  PSKey.Luminance = cTID('Lmnc');
  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.Saving = cTID('Svng');
  PSKey.Scale = cTID('Scl ');
  PSKey.Sharpness = cTID('Shrp');
  PSKey.Start = cTID('Strt');
  PSKey.Threshold = cTID('Thsh');
  PSKey.To = cTID('T   ');
  PSKey.Type = cTID('Type');
  PSKey.Using = cTID('Usng');
  PSKey.Vertical = cTID('Vrtc');
  PSKey.With = cTID('With');
  PSString.Null = sTID('null');
  PSString.a = sTID('a');
  PSString.addToSelection = sTID('addToSelection');
  PSString.addToSelectionContinuous = sTID('addToSelectionContinuous');
  PSString.b = sTID('b');
  PSString.channelDenoise = sTID('channelDenoise');
  PSString.channelDenoiseParams = sTID('channelDenoiseParams');
  PSString.gammaCorrection = sTID('gammaCorrection');
  PSString.largeDocumentFormat = sTID('largeDocumentFormat');
  PSString.layerGroup = sTID('layerSection');
  PSString.linearLight = sTID('linearLight');
  PSString.maximizeCompatibility = sTID('maximizeCompatibility');
  PSString.preset = sTID('preset');
  PSString.presetKind = sTID('presetKind');
  PSString.presetKindCustom = sTID('presetKindCustom');
  PSString.presetKindDefault = sTID('presetKindDefault');
  PSString.presetKindType = sTID('presetKindType');
  PSString.removeJPEGArtifact = sTID('removeJPEGArtifact');
  PSString.selection = sTID('selection');
  PSString.selectionModifier = sTID('selectionModifier');
  PSString.selectionModifierType = sTID('selectionModifierType');
  PSType.AntiAlias = cTID('Annt');
  PSType.AreaSelector = cTID('ArSl');
  PSType.BlendMode = cTID('BlnM');
  PSType.Calculation = cTID('Clcn');
  PSType.FillContents = cTID('FlCn');
  PSType.MaskIndicator = cTID('MskI');
  PSType.Ordinal = cTID('Ordn');
  PSType.YesNo = cTID('YsN ');
  PSUnit.Angle = cTID('#Ang');
  PSUnit.Percent = cTID('#Prc');
  PSUnit.Pixels = cTID('#Pxl');
};

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



//=========================================
//                    HDRX3.main
//=========================================
//

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

HDRX3.main();

// EOF

    },
};

$._ext_C1={
    run : function() {
//
// Generated Thu Aug 20 2015 16:05:45 GMT+0400
//

//
//==================== C1 ==============
//
function C1() {
  // 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.AdjustmentLayer);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    desc2.putString(PSKey.Name, "Colorize White W1");
    var desc3 = new ActionDescriptor();
    desc3.putEnumerated(PSString.presetKind, PSString.presetKindType, PSString.presetKindDefault);
    desc2.putObject(PSKey.Type, PSClass.SelectiveColor, desc3);
    desc1.putObject(PSKey.Using, PSClass.AdjustmentLayer, 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.AdjustmentLayer, PSType.Ordinal, PSEnum.Target);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    desc2.putEnumerated(PSString.presetKind, PSString.presetKindType, PSString.presetKindCustom);
    desc2.putEnumerated(PSKey.Method, PSType.CorrectionMethod, PSEnum.Relative);
    var list1 = new ActionList();
    var desc3 = new ActionDescriptor();
    desc3.putEnumerated(PSKey.Colors, PSKey.Colors, PSEnum.Whites);
    desc3.putUnitDouble(PSKey.Cyan, PSUnit.Percent, -20);
    desc3.putUnitDouble(PSKey.Yellow, PSUnit.Percent, 80);
    desc3.putUnitDouble(PSKey.Black, PSUnit.Percent, 10);
    list1.putObject(PSClass.ColorCorrection, desc3);
    desc2.putList(PSClass.ColorCorrection, list1);
    desc1.putObject(PSKey.To, PSClass.SelectiveColor, desc2);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

  // Make
  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.putClass(PSClass.AdjustmentLayer);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    desc2.putString(PSKey.Name, "Colorize All W1");
    var desc3 = new ActionDescriptor();
    var list1 = new ActionList();
    list1.putInteger(0);
    list1.putInteger(sTID("skinTone"), 0);
    list1.putInteger(sTID("contentAware"), 0);
    desc3.putList(PSKey.ShadowLevels, list1);
    var list2 = new ActionList();
    list2.putInteger(0);
    list2.putInteger(sTID("skinTone"), 0);
    list2.putInteger(sTID("contentAware"), 0);
    desc3.putList(PSKey.MidtoneLevels, list2);
    var list3 = new ActionList();
    list3.putInteger(0);
    list3.putInteger(sTID("skinTone"), 0);
    list3.putInteger(sTID("contentAware"), 0);
    desc3.putList(PSKey.HighlightLevels, list3);
    desc3.putBoolean(PSKey.PreserveLuminosity, true);
    desc2.putObject(PSKey.Type, PSClass.ColorBalance, desc3);
    desc1.putObject(PSKey.Using, PSClass.AdjustmentLayer, desc2);
    executeAction(PSEvent.Make, desc1, dialogMode);
  };

  // Set
  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.AdjustmentLayer, PSType.Ordinal, PSEnum.Target);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    var list1 = new ActionList();
    list1.putInteger(0);
    list1.putInteger(sTID("skinTone"), 0);
    list1.putInteger(sTID("contentAware"), 0);
    desc2.putList(PSKey.ShadowLevels, list1);
    var list2 = new ActionList();
    list2.putInteger(0);
    list2.putInteger(sTID("skinTone"), 0);
    list2.putInteger(sTID("contentAware"), 0);
    desc2.putList(PSKey.MidtoneLevels, list2);
    desc1.putObject(PSKey.To, PSClass.ColorBalance, desc2);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

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

  // Make
  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.AdjustmentLayer);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    desc2.putString(PSKey.Name, "Grading Map W3");
    var desc3 = new ActionDescriptor();
    var desc4 = new ActionDescriptor();
    desc4.putString(PSKey.Name, "Foreground to Background");
    desc4.putEnumerated(PSType.GradientForm, PSType.GradientForm, PSEnum.CustomStops);
    desc4.putDouble(PSKey.Interpolation, 4096);
    var list1 = new ActionList();
    var desc5 = new ActionDescriptor();
    var desc6 = new ActionDescriptor();
    desc6.putDouble(PSKey.Red, 19.9996948242188);
    desc6.putDouble(PSKey.Green, 11.9998168945313);
    desc6.putDouble(PSKey.Blue, 9.00375366210938);
    desc5.putObject(PSClass.Color, PSClass.RGBColor, desc6);
    desc5.putEnumerated(PSKey.Type, PSType.ColorStopType, PSEnum.UserStop);
    desc5.putInteger(PSKey.Location, 0);
    desc5.putInteger(PSKey.Midpoint, 50);
    list1.putObject(PSClass.ColorStop, desc5);
    var desc7 = new ActionDescriptor();
    var desc8 = new ActionDescriptor();
    desc8.putDouble(PSKey.Red, 0);
    desc8.putDouble(PSKey.Green, 0);
    desc8.putDouble(PSKey.Blue, 0);
    desc7.putObject(PSClass.Color, PSClass.RGBColor, desc8);
    desc7.putEnumerated(PSKey.Type, PSType.ColorStopType, PSEnum.UserStop);
    desc7.putInteger(PSKey.Location, 4096);
    desc7.putInteger(PSKey.Midpoint, 50);
    list1.putObject(PSClass.ColorStop, desc7);
    desc4.putList(PSKey.Colors, list1);
    var list2 = new ActionList();
    var desc9 = new ActionDescriptor();
    desc9.putUnitDouble(PSKey.Opacity, PSUnit.Percent, 100);
    desc9.putInteger(PSKey.Location, 0);
    desc9.putInteger(PSKey.Midpoint, 50);
    list2.putObject(PSClass.TransparencyStop, desc9);
    var desc10 = new ActionDescriptor();
    desc10.putUnitDouble(PSKey.Opacity, PSUnit.Percent, 100);
    desc10.putInteger(PSKey.Location, 4096);
    desc10.putInteger(PSKey.Midpoint, 50);
    list2.putObject(PSClass.TransparencyStop, desc10);
    desc4.putList(PSKey.Transparency, list2);
    desc3.putObject(PSKey.Gradient, PSClass.Gradient, desc4);
    desc2.putObject(PSKey.Type, PSClass.GradientMap, desc3);
    desc1.putObject(PSKey.Using, PSClass.AdjustmentLayer, desc2);
    executeAction(PSEvent.Make, 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.AdjustmentLayer, PSType.Ordinal, PSEnum.Target);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    var desc3 = new ActionDescriptor();
    desc3.putString(PSKey.Name, "Custom");
    desc3.putEnumerated(PSType.GradientForm, PSType.GradientForm, PSEnum.CustomStops);
    desc3.putDouble(PSKey.Interpolation, 4096);
    var list1 = new ActionList();
    var desc4 = new ActionDescriptor();
    var desc5 = new ActionDescriptor();
    desc5.putDouble(PSKey.Red, 41.0038923472166);
    desc5.putDouble(PSKey.Green, 10.0000003539026);
    desc5.putDouble(PSKey.Blue, 89.0038932859898);
    desc4.putObject(PSClass.Color, PSClass.RGBColor, desc5);
    desc4.putEnumerated(PSKey.Type, PSType.ColorStopType, PSEnum.UserStop);
    desc4.putInteger(PSKey.Location, 0);
    desc4.putInteger(PSKey.Midpoint, 50);
    list1.putObject(PSClass.ColorStop, desc4);
    var desc6 = new ActionDescriptor();
    var desc7 = new ActionDescriptor();
    desc7.putDouble(PSKey.Red, 255);
    desc7.putDouble(PSKey.Green, 124.000000208616);
    desc7.putDouble(PSKey.Blue, 0);
    desc6.putObject(PSClass.Color, PSClass.RGBColor, desc7);
    desc6.putEnumerated(PSKey.Type, PSType.ColorStopType, PSEnum.UserStop);
    desc6.putInteger(PSKey.Location, 4096);
    desc6.putInteger(PSKey.Midpoint, 23);
    list1.putObject(PSClass.ColorStop, desc6);
    desc3.putList(PSKey.Colors, list1);
    var list2 = new ActionList();
    var desc8 = new ActionDescriptor();
    desc8.putUnitDouble(PSKey.Opacity, PSUnit.Percent, 100);
    desc8.putInteger(PSKey.Location, 0);
    desc8.putInteger(PSKey.Midpoint, 50);
    list2.putObject(PSClass.TransparencyStop, desc8);
    var desc9 = new ActionDescriptor();
    desc9.putUnitDouble(PSKey.Opacity, PSUnit.Percent, 100);
    desc9.putInteger(PSKey.Location, 4096);
    desc9.putInteger(PSKey.Midpoint, 50);
    list2.putObject(PSClass.TransparencyStop, desc9);
    desc3.putList(PSKey.Transparency, list2);
    desc2.putObject(PSKey.Gradient, PSClass.Gradient, desc3);
    desc1.putObject(PSKey.To, PSClass.GradientMap, desc2);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

  // Set
  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.putEnumerated(PSKey.Mode, PSType.BlendMode, PSClass.Color);
    desc1.putObject(PSKey.To, PSClass.Layer, desc2);
    executeAction(PSEvent.Set, 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.putUnitDouble(PSKey.Opacity, PSUnit.Percent, 50);
    desc1.putObject(PSKey.To, PSClass.Layer, desc2);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

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

  // Make
  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.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);
  };

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

  step1();      // Make
  step2();      // Set
  step3();      // Make
  step4();      // Set
  step5();      // Set
  step6();      // Make
  step7();      // Set
  step8();      // Set
  step9();      // Set
  step10();      // Select
  step11();      // Select
  step12();      // Make
  step13();      // Set
};



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

//
// C1.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.
//
C1.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.Color = cTID('Clr ');
  PSClass.ColorBalance = cTID('ClrB');
  PSClass.ColorCorrection = cTID('ClrC');
  PSClass.ColorStop = cTID('Clrt');
  PSClass.Gradient = cTID('Grdn');
  PSClass.GradientMap = cTID('GdMp');
  PSClass.Layer = cTID('Lyr ');
  PSClass.RGBColor = cTID('RGBC');
  PSClass.SelectiveColor = cTID('SlcC');
  PSClass.TransparencyStop = cTID('TrnS');
  PSEnum.CustomStops = cTID('CstS');
  PSEnum.Relative = cTID('Rltv');
  PSEnum.SoftLight = cTID('SftL');
  PSEnum.Target = cTID('Trgt');
  PSEnum.UserStop = cTID('UsrS');
  PSEnum.Whites = cTID('Whts');
  PSEvent.Make = cTID('Mk  ');
  PSEvent.Select = cTID('slct');
  PSEvent.Set = cTID('setd');
  PSKey.Black = cTID('Blck');
  PSKey.Blue = cTID('Bl  ');
  PSKey.Colors = cTID('Clrs');
  PSKey.Cyan = cTID('Cyn ');
  PSKey.From = cTID('From');
  PSKey.Gradient = cTID('Grad');
  PSKey.Green = cTID('Grn ');
  PSKey.HighlightLevels = cTID('HghL');
  PSKey.Interpolation = cTID('Intr');
  PSKey.Location = cTID('Lctn');
  PSKey.MakeVisible = cTID('MkVs');
  PSKey.Method = cTID('Mthd');
  PSKey.Midpoint = cTID('Mdpn');
  PSKey.MidtoneLevels = cTID('MdtL');
  PSKey.Mode = cTID('Md  ');
  PSKey.Name = cTID('Nm  ');
  PSKey.Opacity = cTID('Opct');
  PSKey.PreserveLuminosity = cTID('PrsL');
  PSKey.Red = cTID('Rd  ');
  PSKey.ShadowLevels = cTID('ShdL');
  PSKey.To = cTID('T   ');
  PSKey.Transparency = cTID('Trns');
  PSKey.Type = cTID('Type');
  PSKey.Using = cTID('Usng');
  PSKey.Yellow = cTID('Ylw ');
  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.selectionModifier = sTID('selectionModifier');
  PSString.selectionModifierType = sTID('selectionModifierType');
  PSString.solidColorLayer = sTID('solidColorLayer');
  PSType.BlendMode = cTID('BlnM');
  PSType.ColorStopType = cTID('Clry');
  PSType.CorrectionMethod = cTID('CrcM');
  PSType.GradientForm = cTID('GrdF');
  PSType.Ordinal = cTID('Ordn');
  PSUnit.Percent = cTID('#Prc');
};

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



//=========================================
//                    C1.main
//=========================================
//

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

C1.main();

// EOF

    },
};

$._ext_C2={
    run : function() {
//
// Generated Thu Aug 20 2015 16:05:45 GMT+0400
//

//
//==================== C2  ==============
//
function C2() {
  // 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.AdjustmentLayer);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    desc2.putString(PSKey.Name, "Colorize White W2");
    var desc3 = new ActionDescriptor();
    desc3.putEnumerated(PSString.presetKind, PSString.presetKindType, PSString.presetKindDefault);
    desc2.putObject(PSKey.Type, PSClass.SelectiveColor, desc3);
    desc1.putObject(PSKey.Using, PSClass.AdjustmentLayer, 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.AdjustmentLayer, PSType.Ordinal, PSEnum.Target);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    var list1 = new ActionList();
    var desc3 = new ActionDescriptor();
    desc3.putEnumerated(PSKey.Colors, PSKey.Colors, PSEnum.Whites);
    desc3.putUnitDouble(PSKey.Yellow, PSUnit.Percent, 50);
    list1.putObject(PSClass.ColorCorrection, desc3);
    desc2.putList(PSClass.ColorCorrection, list1);
    desc1.putObject(PSKey.To, PSClass.SelectiveColor, desc2);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

  // Make
  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.putClass(PSClass.AdjustmentLayer);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    desc2.putString(PSKey.Name, "Colorize All W2");
    var desc3 = new ActionDescriptor();
    var list1 = new ActionList();
    list1.putInteger(0);
    list1.putInteger(sTID("skinTone"), 0);
    list1.putInteger(sTID("contentAware"), 0);
    desc3.putList(PSKey.ShadowLevels, list1);
    var list2 = new ActionList();
    list2.putInteger(0);
    list2.putInteger(sTID("skinTone"), 0);
    list2.putInteger(sTID("contentAware"), 0);
    desc3.putList(PSKey.MidtoneLevels, list2);
    var list3 = new ActionList();
    list3.putInteger(0);
    list3.putInteger(sTID("skinTone"), 0);
    list3.putInteger(sTID("contentAware"), 0);
    desc3.putList(PSKey.HighlightLevels, list3);
    desc3.putBoolean(PSKey.PreserveLuminosity, true);
    desc2.putObject(PSKey.Type, PSClass.ColorBalance, desc3);
    desc1.putObject(PSKey.Using, PSClass.AdjustmentLayer, desc2);
    executeAction(PSEvent.Make, desc1, dialogMode);
  };

  // Set
  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.AdjustmentLayer, PSType.Ordinal, PSEnum.Target);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    var list1 = new ActionList();
    list1.putInteger(5);
    list1.putInteger(sTID("skinTone"), 0);
    list1.putInteger(sTID("contentAware"), 5);
    desc2.putList(PSKey.ShadowLevels, list1);
    var list2 = new ActionList();
    list2.putInteger(5);
    list2.putInteger(sTID("skinTone"), 0);
    list2.putInteger(sTID("contentAware"), -10);
    desc2.putList(PSKey.MidtoneLevels, list2);
    var list3 = new ActionList();
    list3.putInteger(5);
    list3.putInteger(sTID("skinTone"), 0);
    list3.putInteger(sTID("contentAware"), -10);
    desc2.putList(PSKey.HighlightLevels, list3);
    desc1.putObject(PSKey.To, PSClass.ColorBalance, desc2);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

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

  // Make
  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.AdjustmentLayer);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    desc2.putString(PSKey.Name, "Grading Map W2");
    var desc3 = new ActionDescriptor();
    var desc4 = new ActionDescriptor();
    desc4.putString(PSKey.Name, "Foreground to Background");
    desc4.putEnumerated(PSType.GradientForm, PSType.GradientForm, PSEnum.CustomStops);
    desc4.putDouble(PSKey.Interpolation, 4096);
    var list1 = new ActionList();
    var desc5 = new ActionDescriptor();
    var desc6 = new ActionDescriptor();
    desc6.putDouble(PSKey.Red, 19.9996948242188);
    desc6.putDouble(PSKey.Green, 11.9998168945313);
    desc6.putDouble(PSKey.Blue, 9.00375366210938);
    desc5.putObject(PSClass.Color, PSClass.RGBColor, desc6);
    desc5.putEnumerated(PSKey.Type, PSType.ColorStopType, PSEnum.UserStop);
    desc5.putInteger(PSKey.Location, 0);
    desc5.putInteger(PSKey.Midpoint, 50);
    list1.putObject(PSClass.ColorStop, desc5);
    var desc7 = new ActionDescriptor();
    var desc8 = new ActionDescriptor();
    desc8.putDouble(PSKey.Red, 0);
    desc8.putDouble(PSKey.Green, 0);
    desc8.putDouble(PSKey.Blue, 0);
    desc7.putObject(PSClass.Color, PSClass.RGBColor, desc8);
    desc7.putEnumerated(PSKey.Type, PSType.ColorStopType, PSEnum.UserStop);
    desc7.putInteger(PSKey.Location, 4096);
    desc7.putInteger(PSKey.Midpoint, 50);
    list1.putObject(PSClass.ColorStop, desc7);
    desc4.putList(PSKey.Colors, list1);
    var list2 = new ActionList();
    var desc9 = new ActionDescriptor();
    desc9.putUnitDouble(PSKey.Opacity, PSUnit.Percent, 100);
    desc9.putInteger(PSKey.Location, 0);
    desc9.putInteger(PSKey.Midpoint, 50);
    list2.putObject(PSClass.TransparencyStop, desc9);
    var desc10 = new ActionDescriptor();
    desc10.putUnitDouble(PSKey.Opacity, PSUnit.Percent, 100);
    desc10.putInteger(PSKey.Location, 4096);
    desc10.putInteger(PSKey.Midpoint, 50);
    list2.putObject(PSClass.TransparencyStop, desc10);
    desc4.putList(PSKey.Transparency, list2);
    desc3.putObject(PSKey.Gradient, PSClass.Gradient, desc4);
    desc2.putObject(PSKey.Type, PSClass.GradientMap, desc3);
    desc1.putObject(PSKey.Using, PSClass.AdjustmentLayer, desc2);
    executeAction(PSEvent.Make, 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.AdjustmentLayer, PSType.Ordinal, PSEnum.Target);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    var desc3 = new ActionDescriptor();
    desc3.putString(PSKey.Name, "$$$/Presets/Gradients/ColorHarmonies1_grd/OrangeBlue=Orange, Blue");
    desc3.putEnumerated(PSType.GradientForm, PSType.GradientForm, PSEnum.CustomStops);
    desc3.putDouble(PSKey.Interpolation, 4096);
    var list1 = new ActionList();
    var desc4 = new ActionDescriptor();
    var desc5 = new ActionDescriptor();
    desc5.putDouble(PSKey.Red, 253.000000119209);
    desc5.putDouble(PSKey.Green, 124.000000208616);
    desc5.putDouble(PSKey.Blue, 0);
    desc4.putObject(PSClass.Color, PSClass.RGBColor, desc5);
    desc4.putEnumerated(PSKey.Type, PSType.ColorStopType, PSEnum.UserStop);
    desc4.putInteger(PSKey.Location, 0);
    desc4.putInteger(PSKey.Midpoint, 50);
    list1.putObject(PSClass.ColorStop, desc4);
    var desc6 = new ActionDescriptor();
    var desc7 = new ActionDescriptor();
    desc7.putDouble(PSKey.Red, 0);
    desc7.putDouble(PSKey.Green, 40.0000014156103);
    desc7.putDouble(PSKey.Blue, 116.000000685453);
    desc6.putObject(PSClass.Color, PSClass.RGBColor, desc7);
    desc6.putEnumerated(PSKey.Type, PSType.ColorStopType, PSEnum.UserStop);
    desc6.putInteger(PSKey.Location, 4096);
    desc6.putInteger(PSKey.Midpoint, 50);
    list1.putObject(PSClass.ColorStop, desc6);
    desc3.putList(PSKey.Colors, list1);
    var list2 = new ActionList();
    var desc8 = new ActionDescriptor();
    desc8.putUnitDouble(PSKey.Opacity, PSUnit.Percent, 100);
    desc8.putInteger(PSKey.Location, 0);
    desc8.putInteger(PSKey.Midpoint, 50);
    list2.putObject(PSClass.TransparencyStop, desc8);
    var desc9 = new ActionDescriptor();
    desc9.putUnitDouble(PSKey.Opacity, PSUnit.Percent, 100);
    desc9.putInteger(PSKey.Location, 4096);
    desc9.putInteger(PSKey.Midpoint, 50);
    list2.putObject(PSClass.TransparencyStop, desc9);
    desc3.putList(PSKey.Transparency, list2);
    desc2.putObject(PSKey.Gradient, PSClass.Gradient, desc3);
    desc1.putObject(PSKey.To, PSClass.GradientMap, desc2);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

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

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

  // Select
  function step10(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var desc1 = new ActionDescriptor();
    var ref1 = new ActionReference();
    ref1.putEnumerated(PSClass.Channel, PSClass.Channel, PSEnum.RGB);
    desc1.putReference(PSString.Null, ref1);
    desc1.putBoolean(PSKey.MakeVisible, false);
    executeAction(PSEvent.Select, 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.putName(PSClass.Layer, "Grading Map W2");
    desc1.putReference(PSString.Null, ref1);
    desc1.putBoolean(PSKey.MakeVisible, false);
    executeAction(PSEvent.Select, desc1, dialogMode);
  };

  // Set
  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.AdjustmentLayer, PSType.Ordinal, PSEnum.Target);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    var desc3 = new ActionDescriptor();
    desc3.putString(PSKey.Name, "Custom");
    desc3.putEnumerated(PSType.GradientForm, PSType.GradientForm, PSEnum.CustomStops);
    desc3.putDouble(PSKey.Interpolation, 4096);
    var list1 = new ActionList();
    var desc4 = new ActionDescriptor();
    var desc5 = new ActionDescriptor();
    desc5.putDouble(PSKey.Red, 253.000000119209);
    desc5.putDouble(PSKey.Green, 124.000000208616);
    desc5.putDouble(PSKey.Blue, 0);
    desc4.putObject(PSClass.Color, PSClass.RGBColor, desc5);
    desc4.putEnumerated(PSKey.Type, PSType.ColorStopType, PSEnum.UserStop);
    desc4.putInteger(PSKey.Location, 0);
    desc4.putInteger(PSKey.Midpoint, 50);
    list1.putObject(PSClass.ColorStop, desc4);
    var desc6 = new ActionDescriptor();
    var desc7 = new ActionDescriptor();
    desc7.putDouble(PSKey.Red, 0);
    desc7.putDouble(PSKey.Green, 40.0000014156103);
    desc7.putDouble(PSKey.Blue, 116.000000685453);
    desc6.putObject(PSClass.Color, PSClass.RGBColor, desc7);
    desc6.putEnumerated(PSKey.Type, PSType.ColorStopType, PSEnum.UserStop);
    desc6.putInteger(PSKey.Location, 4096);
    desc6.putInteger(PSKey.Midpoint, 67);
    list1.putObject(PSClass.ColorStop, desc6);
    desc3.putList(PSKey.Colors, list1);
    var list2 = new ActionList();
    var desc8 = new ActionDescriptor();
    desc8.putUnitDouble(PSKey.Opacity, PSUnit.Percent, 100);
    desc8.putInteger(PSKey.Location, 0);
    desc8.putInteger(PSKey.Midpoint, 50);
    list2.putObject(PSClass.TransparencyStop, desc8);
    var desc9 = new ActionDescriptor();
    desc9.putUnitDouble(PSKey.Opacity, PSUnit.Percent, 100);
    desc9.putInteger(PSKey.Location, 4096);
    desc9.putInteger(PSKey.Midpoint, 50);
    list2.putObject(PSClass.TransparencyStop, desc9);
    desc3.putList(PSKey.Transparency, list2);
    desc2.putObject(PSKey.Gradient, PSClass.Gradient, desc3);
    desc1.putObject(PSKey.To, PSClass.GradientMap, desc2);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

  // Move
  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 ref2 = new ActionReference();
    ref2.putEnumerated(PSClass.Layer, PSType.Ordinal, PSEnum.Previous);
    desc1.putReference(PSKey.To, ref2);
    executeAction(PSEvent.Move, desc1, dialogMode);
  };

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

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

  // Make
  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.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);
  };

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

  step1();      // Make
  step2();      // Set
  step3();      // Make
  step4();      // Set
  step5();      // Set
  step6();      // Make
  step7();      // Set
  step8();      // Set
  step9();      // Select
  step10();      // Select
  step11();      // Select
  step12();      // Set
  step13();      // Move
  step14();      // Move
  step15();      // Set
  step16();      // Set
  step17();      // Select
  step18();      // Make
  step19();      // Set
};



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

//
// C2.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.
//
C2.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.Color = cTID('Clr ');
  PSClass.ColorBalance = cTID('ClrB');
  PSClass.ColorCorrection = cTID('ClrC');
  PSClass.ColorStop = cTID('Clrt');
  PSClass.Gradient = cTID('Grdn');
  PSClass.GradientMap = cTID('GdMp');
  PSClass.Layer = cTID('Lyr ');
  PSClass.RGBColor = cTID('RGBC');
  PSClass.SelectiveColor = cTID('SlcC');
  PSClass.TransparencyStop = cTID('TrnS');
  PSEnum.CustomStops = cTID('CstS');
  PSEnum.Previous = cTID('Prvs');
  PSEnum.RGB = cTID('RGB ');
  PSEnum.Relative = cTID('Rltv');
  PSEnum.SoftLight = cTID('SftL');
  PSEnum.Target = cTID('Trgt');
  PSEnum.UserStop = cTID('UsrS');
  PSEnum.Whites = cTID('Whts');
  PSEvent.Make = cTID('Mk  ');
  PSEvent.Move = cTID('move');
  PSEvent.Select = cTID('slct');
  PSEvent.Set = cTID('setd');
  PSKey.Black = cTID('Blck');
  PSKey.Blue = cTID('Bl  ');
  PSKey.Colors = cTID('Clrs');
  PSKey.Cyan = cTID('Cyn ');
  PSKey.From = cTID('From');
  PSKey.Gradient = cTID('Grad');
  PSKey.Green = cTID('Grn ');
  PSKey.HighlightLevels = cTID('HghL');
  PSKey.Interpolation = cTID('Intr');
  PSKey.Location = cTID('Lctn');
  PSKey.MakeVisible = cTID('MkVs');
  PSKey.Method = cTID('Mthd');
  PSKey.Midpoint = cTID('Mdpn');
  PSKey.MidtoneLevels = cTID('MdtL');
  PSKey.Mode = cTID('Md  ');
  PSKey.Name = cTID('Nm  ');
  PSKey.Opacity = cTID('Opct');
  PSKey.PreserveLuminosity = cTID('PrsL');
  PSKey.Red = cTID('Rd  ');
  PSKey.Reverse = cTID('Rvrs');
  PSKey.ShadowLevels = cTID('ShdL');
  PSKey.To = cTID('T   ');
  PSKey.Transparency = cTID('Trns');
  PSKey.Type = cTID('Type');
  PSKey.Using = cTID('Usng');
  PSKey.Yellow = cTID('Ylw ');
  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.selectionModifier = sTID('selectionModifier');
  PSString.selectionModifierType = sTID('selectionModifierType');
  PSString.solidColorLayer = sTID('solidColorLayer');
  PSType.BlendMode = cTID('BlnM');
  PSType.ColorStopType = cTID('Clry');
  PSType.CorrectionMethod = cTID('CrcM');
  PSType.GradientForm = cTID('GrdF');
  PSType.Ordinal = cTID('Ordn');
  PSUnit.Percent = cTID('#Prc');
};

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



//=========================================
//                    C2.main
//=========================================
//

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

C2.main();

// EOF

    },
};

$._ext_C3={
    run : function() {
//
// Generated Thu Aug 20 2015 16:05:45 GMT+0400
//

//
//==================== C3 ==============
//
function C3() {
  // 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.AdjustmentLayer);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    desc2.putString(PSKey.Name, "Colorize White W3");
    var desc3 = new ActionDescriptor();
    desc3.putEnumerated(PSString.presetKind, PSString.presetKindType, PSString.presetKindDefault);
    desc2.putObject(PSKey.Type, PSClass.SelectiveColor, desc3);
    desc1.putObject(PSKey.Using, PSClass.AdjustmentLayer, 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.AdjustmentLayer, PSType.Ordinal, PSEnum.Target);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    var list1 = new ActionList();
    var desc3 = new ActionDescriptor();
    desc3.putEnumerated(PSKey.Colors, PSKey.Colors, PSEnum.Whites);
    desc3.putUnitDouble(PSKey.Yellow, PSUnit.Percent, 50);
    list1.putObject(PSClass.ColorCorrection, desc3);
    desc2.putList(PSClass.ColorCorrection, list1);
    desc1.putObject(PSKey.To, PSClass.SelectiveColor, desc2);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

  // Make
  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.putClass(PSClass.AdjustmentLayer);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    desc2.putString(PSKey.Name, "Colorize All W3");
    var desc3 = new ActionDescriptor();
    var list1 = new ActionList();
    list1.putInteger(0);
    list1.putInteger(sTID("skinTone"), 0);
    list1.putInteger(sTID("contentAware"), 0);
    desc3.putList(PSKey.ShadowLevels, list1);
    var list2 = new ActionList();
    list2.putInteger(0);
    list2.putInteger(sTID("skinTone"), 0);
    list2.putInteger(sTID("contentAware"), 0);
    desc3.putList(PSKey.MidtoneLevels, list2);
    var list3 = new ActionList();
    list3.putInteger(0);
    list3.putInteger(sTID("skinTone"), 0);
    list3.putInteger(sTID("contentAware"), 0);
    desc3.putList(PSKey.HighlightLevels, list3);
    desc3.putBoolean(PSKey.PreserveLuminosity, true);
    desc2.putObject(PSKey.Type, PSClass.ColorBalance, desc3);
    desc1.putObject(PSKey.Using, PSClass.AdjustmentLayer, desc2);
    executeAction(PSEvent.Make, desc1, dialogMode);
  };

  // Set
  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.AdjustmentLayer, PSType.Ordinal, PSEnum.Target);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    var list1 = new ActionList();
    list1.putInteger(5);
    list1.putInteger(sTID("skinTone"), 0);
    list1.putInteger(sTID("contentAware"), 5);
    desc2.putList(PSKey.ShadowLevels, list1);
    var list2 = new ActionList();
    list2.putInteger(5);
    list2.putInteger(sTID("skinTone"), 0);
    list2.putInteger(sTID("contentAware"), -10);
    desc2.putList(PSKey.MidtoneLevels, list2);
    var list3 = new ActionList();
    list3.putInteger(5);
    list3.putInteger(sTID("skinTone"), 0);
    list3.putInteger(sTID("contentAware"), -10);
    desc2.putList(PSKey.HighlightLevels, list3);
    desc1.putObject(PSKey.To, PSClass.ColorBalance, desc2);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

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

  // Make
  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.AdjustmentLayer);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    desc2.putString(PSKey.Name, "Grading Map W3");
    var desc3 = new ActionDescriptor();
    var desc4 = new ActionDescriptor();
    desc4.putString(PSKey.Name, "Foreground to Background");
    desc4.putEnumerated(PSType.GradientForm, PSType.GradientForm, PSEnum.CustomStops);
    desc4.putDouble(PSKey.Interpolation, 4096);
    var list1 = new ActionList();
    var desc5 = new ActionDescriptor();
    var desc6 = new ActionDescriptor();
    desc6.putDouble(PSKey.Red, 19.9996948242188);
    desc6.putDouble(PSKey.Green, 11.9998168945313);
    desc6.putDouble(PSKey.Blue, 9.00375366210938);
    desc5.putObject(PSClass.Color, PSClass.RGBColor, desc6);
    desc5.putEnumerated(PSKey.Type, PSType.ColorStopType, PSEnum.UserStop);
    desc5.putInteger(PSKey.Location, 0);
    desc5.putInteger(PSKey.Midpoint, 50);
    list1.putObject(PSClass.ColorStop, desc5);
    var desc7 = new ActionDescriptor();
    var desc8 = new ActionDescriptor();
    desc8.putDouble(PSKey.Red, 0);
    desc8.putDouble(PSKey.Green, 0);
    desc8.putDouble(PSKey.Blue, 0);
    desc7.putObject(PSClass.Color, PSClass.RGBColor, desc8);
    desc7.putEnumerated(PSKey.Type, PSType.ColorStopType, PSEnum.UserStop);
    desc7.putInteger(PSKey.Location, 4096);
    desc7.putInteger(PSKey.Midpoint, 50);
    list1.putObject(PSClass.ColorStop, desc7);
    desc4.putList(PSKey.Colors, list1);
    var list2 = new ActionList();
    var desc9 = new ActionDescriptor();
    desc9.putUnitDouble(PSKey.Opacity, PSUnit.Percent, 100);
    desc9.putInteger(PSKey.Location, 0);
    desc9.putInteger(PSKey.Midpoint, 50);
    list2.putObject(PSClass.TransparencyStop, desc9);
    var desc10 = new ActionDescriptor();
    desc10.putUnitDouble(PSKey.Opacity, PSUnit.Percent, 100);
    desc10.putInteger(PSKey.Location, 4096);
    desc10.putInteger(PSKey.Midpoint, 50);
    list2.putObject(PSClass.TransparencyStop, desc10);
    desc4.putList(PSKey.Transparency, list2);
    desc3.putObject(PSKey.Gradient, PSClass.Gradient, desc4);
    desc2.putObject(PSKey.Type, PSClass.GradientMap, desc3);
    desc1.putObject(PSKey.Using, PSClass.AdjustmentLayer, desc2);
    executeAction(PSEvent.Make, 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.AdjustmentLayer, PSType.Ordinal, PSEnum.Target);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    var desc3 = new ActionDescriptor();
    desc3.putString(PSKey.Name, "$$$/Presets/Gradients/ColorHarmonies1_grd/YellowViolet=Yellow, Violet");
    desc3.putEnumerated(PSType.GradientForm, PSType.GradientForm, PSEnum.CustomStops);
    desc3.putDouble(PSKey.Interpolation, 4096);
    var list1 = new ActionList();
    var desc4 = new ActionDescriptor();
    var desc5 = new ActionDescriptor();
    desc5.putDouble(PSKey.Red, 249.000000357628);
    desc5.putDouble(PSKey.Green, 229.996110498905);
    desc5.putDouble(PSKey.Blue, 0);
    desc4.putObject(PSClass.Color, PSClass.RGBColor, desc5);
    desc4.putEnumerated(PSKey.Type, PSType.ColorStopType, PSEnum.UserStop);
    desc4.putInteger(PSKey.Location, 0);
    desc4.putInteger(PSKey.Midpoint, 50);
    list1.putObject(PSClass.ColorStop, desc4);
    var desc6 = new ActionDescriptor();
    var desc7 = new ActionDescriptor();
    desc7.putDouble(PSKey.Red, 111.003891974688);
    desc7.putDouble(PSKey.Green, 21.0038916394114);
    desc7.putDouble(PSKey.Blue, 108.000001162291);
    desc6.putObject(PSClass.Color, PSClass.RGBColor, desc7);
    desc6.putEnumerated(PSKey.Type, PSType.ColorStopType, PSEnum.UserStop);
    desc6.putInteger(PSKey.Location, 4096);
    desc6.putInteger(PSKey.Midpoint, 50);
    list1.putObject(PSClass.ColorStop, desc6);
    desc3.putList(PSKey.Colors, list1);
    var list2 = new ActionList();
    var desc8 = new ActionDescriptor();
    desc8.putUnitDouble(PSKey.Opacity, PSUnit.Percent, 100);
    desc8.putInteger(PSKey.Location, 0);
    desc8.putInteger(PSKey.Midpoint, 50);
    list2.putObject(PSClass.TransparencyStop, desc8);
    var desc9 = new ActionDescriptor();
    desc9.putUnitDouble(PSKey.Opacity, PSUnit.Percent, 100);
    desc9.putInteger(PSKey.Location, 4096);
    desc9.putInteger(PSKey.Midpoint, 50);
    list2.putObject(PSClass.TransparencyStop, desc9);
    desc3.putList(PSKey.Transparency, list2);
    desc2.putObject(PSKey.Gradient, PSClass.Gradient, desc3);
    desc1.putObject(PSKey.To, PSClass.GradientMap, desc2);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

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

  // Move
  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 ref2 = new ActionReference();
    ref2.putEnumerated(PSClass.Layer, PSType.Ordinal, PSEnum.Previous);
    desc1.putReference(PSKey.To, ref2);
    executeAction(PSEvent.Move, desc1, dialogMode);
  };

  // Move
  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 ref2 = new ActionReference();
    ref2.putEnumerated(PSClass.Layer, PSType.Ordinal, PSEnum.Previous);
    desc1.putReference(PSKey.To, ref2);
    executeAction(PSEvent.Move, desc1, dialogMode);
  };

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

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

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

  // Make
  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.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);
  };

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

  step1();      // Make
  step2();      // Set
  step3();      // Make
  step4();      // Set
  step5();      // Set
  step6();      // Make
  step7();      // Set
  step8();      // Set
  step9();      // Move
  step10();      // Move
  step11();      // Set
  step12();      // Set
  step13();      // Select
  step14();      // Make
  step15();      // Set
};



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

//
// C3.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.
//
C3.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.Color = cTID('Clr ');
  PSClass.ColorBalance = cTID('ClrB');
  PSClass.ColorCorrection = cTID('ClrC');
  PSClass.ColorStop = cTID('Clrt');
  PSClass.Gradient = cTID('Grdn');
  PSClass.GradientMap = cTID('GdMp');
  PSClass.Layer = cTID('Lyr ');
  PSClass.RGBColor = cTID('RGBC');
  PSClass.SelectiveColor = cTID('SlcC');
  PSClass.TransparencyStop = cTID('TrnS');
  PSEnum.CustomStops = cTID('CstS');
  PSEnum.Previous = cTID('Prvs');
  PSEnum.RGB = cTID('RGB ');
  PSEnum.Relative = cTID('Rltv');
  PSEnum.SoftLight = cTID('SftL');
  PSEnum.Target = cTID('Trgt');
  PSEnum.UserStop = cTID('UsrS');
  PSEnum.Whites = cTID('Whts');
  PSEvent.Make = cTID('Mk  ');
  PSEvent.Move = cTID('move');
  PSEvent.Select = cTID('slct');
  PSEvent.Set = cTID('setd');
  PSKey.Black = cTID('Blck');
  PSKey.Blue = cTID('Bl  ');
  PSKey.Colors = cTID('Clrs');
  PSKey.Cyan = cTID('Cyn ');
  PSKey.From = cTID('From');
  PSKey.Gradient = cTID('Grad');
  PSKey.Green = cTID('Grn ');
  PSKey.HighlightLevels = cTID('HghL');
  PSKey.Interpolation = cTID('Intr');
  PSKey.Location = cTID('Lctn');
  PSKey.MakeVisible = cTID('MkVs');
  PSKey.Method = cTID('Mthd');
  PSKey.Midpoint = cTID('Mdpn');
  PSKey.MidtoneLevels = cTID('MdtL');
  PSKey.Mode = cTID('Md  ');
  PSKey.Name = cTID('Nm  ');
  PSKey.Opacity = cTID('Opct');
  PSKey.PreserveLuminosity = cTID('PrsL');
  PSKey.Red = cTID('Rd  ');
  PSKey.Reverse = cTID('Rvrs');
  PSKey.ShadowLevels = cTID('ShdL');
  PSKey.To = cTID('T   ');
  PSKey.Transparency = cTID('Trns');
  PSKey.Type = cTID('Type');
  PSKey.Using = cTID('Usng');
  PSKey.Yellow = cTID('Ylw ');
  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.selectionModifier = sTID('selectionModifier');
  PSString.selectionModifierType = sTID('selectionModifierType');
  PSString.solidColorLayer = sTID('solidColorLayer');
  PSType.BlendMode = cTID('BlnM');
  PSType.ColorStopType = cTID('Clry');
  PSType.CorrectionMethod = cTID('CrcM');
  PSType.GradientForm = cTID('GrdF');
  PSType.Ordinal = cTID('Ordn');
  PSUnit.Percent = cTID('#Prc');
};

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



//=========================================
//                    C3.main
//=========================================
//

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

C3.main();

// EOF

    },
};

$._ext_G1={
    run : function() {
//
// Generated Thu Aug 20 2015 16:05:45 GMT+0400
//

//
//==================== G1  ==============
//
function G1() {
  // 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.AdjustmentLayer);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    desc2.putString(PSKey.Name, "Colorize White G1");
    var desc3 = new ActionDescriptor();
    desc3.putEnumerated(PSString.presetKind, PSString.presetKindType, PSString.presetKindDefault);
    desc2.putObject(PSKey.Type, PSClass.SelectiveColor, desc3);
    desc1.putObject(PSKey.Using, PSClass.AdjustmentLayer, 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.AdjustmentLayer, PSType.Ordinal, PSEnum.Target);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    desc2.putEnumerated(PSString.presetKind, PSString.presetKindType, PSString.presetKindCustom);
    desc2.putEnumerated(PSKey.Method, PSType.CorrectionMethod, PSEnum.Relative);
    var list1 = new ActionList();
    var desc3 = new ActionDescriptor();
    desc3.putEnumerated(PSKey.Colors, PSKey.Colors, PSEnum.Whites);
    desc3.putUnitDouble(PSKey.Cyan, PSUnit.Percent, -20);
    desc3.putUnitDouble(PSKey.Yellow, PSUnit.Percent, 80);
    desc3.putUnitDouble(PSKey.Black, PSUnit.Percent, 10);
    list1.putObject(PSClass.ColorCorrection, desc3);
    desc2.putList(PSClass.ColorCorrection, list1);
    desc1.putObject(PSKey.To, PSClass.SelectiveColor, desc2);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

  // Make
  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.putClass(PSClass.AdjustmentLayer);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    desc2.putString(PSKey.Name, "Colorize All G1");
    var desc3 = new ActionDescriptor();
    var list1 = new ActionList();
    list1.putInteger(0);
    list1.putInteger(sTID("skinTone"), 0);
    list1.putInteger(sTID("contentAware"), 0);
    desc3.putList(PSKey.ShadowLevels, list1);
    var list2 = new ActionList();
    list2.putInteger(0);
    list2.putInteger(sTID("skinTone"), 0);
    list2.putInteger(sTID("contentAware"), 0);
    desc3.putList(PSKey.MidtoneLevels, list2);
    var list3 = new ActionList();
    list3.putInteger(0);
    list3.putInteger(sTID("skinTone"), 0);
    list3.putInteger(sTID("contentAware"), 0);
    desc3.putList(PSKey.HighlightLevels, list3);
    desc3.putBoolean(PSKey.PreserveLuminosity, true);
    desc2.putObject(PSKey.Type, PSClass.ColorBalance, desc3);
    desc1.putObject(PSKey.Using, PSClass.AdjustmentLayer, desc2);
    executeAction(PSEvent.Make, desc1, dialogMode);
  };

  // Set
  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.AdjustmentLayer, PSType.Ordinal, PSEnum.Target);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    var list1 = new ActionList();
    list1.putInteger(0);
    list1.putInteger(sTID("skinTone"), 0);
    list1.putInteger(sTID("contentAware"), 5);
    desc2.putList(PSKey.ShadowLevels, list1);
    var list2 = new ActionList();
    list2.putInteger(15);
    list2.putInteger(sTID("skinTone"), 0);
    list2.putInteger(sTID("contentAware"), 8);
    desc2.putList(PSKey.MidtoneLevels, list2);
    var list3 = new ActionList();
    list3.putInteger(10);
    list3.putInteger(sTID("skinTone"), 0);
    list3.putInteger(sTID("contentAware"), -20);
    desc2.putList(PSKey.HighlightLevels, list3);
    desc1.putObject(PSKey.To, PSClass.ColorBalance, desc2);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

  // Set
  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.AdjustmentLayer, PSType.Ordinal, PSEnum.Target);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    var list1 = new ActionList();
    list1.putInteger(15);
    list1.putInteger(sTID("skinTone"), 0);
    list1.putInteger(sTID("contentAware"), -10);
    desc2.putList(PSKey.MidtoneLevels, list1);
    desc1.putObject(PSKey.To, PSClass.ColorBalance, desc2);
    executeAction(PSEvent.Set, 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.putEnumerated(PSKey.Mode, PSType.BlendMode, PSClass.Color);
    desc1.putObject(PSKey.To, PSClass.Layer, desc2);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

  // Make
  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.putClass(PSString.contentLayer);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    desc2.putString(PSKey.Name, "Soft Light Grading G1");
    var desc3 = new ActionDescriptor();
    var desc4 = new ActionDescriptor();
    desc4.putDouble(PSKey.Red, 229.501939415932);
    desc4.putDouble(PSKey.Green, 143.447470664978);
    desc4.putDouble(PSKey.Blue, 22.949415743351);
    desc3.putObject(PSClass.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 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.putUnitDouble(PSKey.Opacity, PSUnit.Percent, 20);
    desc1.putObject(PSKey.To, PSClass.Layer, desc2);
    executeAction(PSEvent.Set, 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.Mode, PSType.BlendMode, PSEnum.SoftLight);
    desc1.putObject(PSKey.To, PSClass.Layer, desc2);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

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

  // Make
  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.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);
  };

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

  step1();      // Make
  step2();      // Set
  step3();      // Make
  step4();      // Set
  step5();      // Set
  step6();      // Set
  step7();      // Make
  step8();      // Set
  step9();      // Set
  step10();      // Select
  step11();      // Make
  step12();      // Set
};



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

//
// G1.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.
//
G1.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.Color = cTID('Clr ');
  PSClass.ColorBalance = cTID('ClrB');
  PSClass.ColorCorrection = cTID('ClrC');
  PSClass.Layer = cTID('Lyr ');
  PSClass.RGBColor = cTID('RGBC');
  PSClass.SelectiveColor = cTID('SlcC');
  PSEnum.Relative = cTID('Rltv');
  PSEnum.SoftLight = cTID('SftL');
  PSEnum.Target = cTID('Trgt');
  PSEnum.Whites = cTID('Whts');
  PSEvent.Make = cTID('Mk  ');
  PSEvent.Select = cTID('slct');
  PSEvent.Set = cTID('setd');
  PSKey.Black = cTID('Blck');
  PSKey.Blue = cTID('Bl  ');
  PSKey.Colors = cTID('Clrs');
  PSKey.Cyan = cTID('Cyn ');
  PSKey.From = cTID('From');
  PSKey.Green = cTID('Grn ');
  PSKey.HighlightLevels = cTID('HghL');
  PSKey.MakeVisible = cTID('MkVs');
  PSKey.Method = cTID('Mthd');
  PSKey.MidtoneLevels = cTID('MdtL');
  PSKey.Mode = cTID('Md  ');
  PSKey.Name = cTID('Nm  ');
  PSKey.Opacity = cTID('Opct');
  PSKey.PreserveLuminosity = cTID('PrsL');
  PSKey.Red = cTID('Rd  ');
  PSKey.ShadowLevels = cTID('ShdL');
  PSKey.To = cTID('T   ');
  PSKey.Type = cTID('Type');
  PSKey.Using = cTID('Usng');
  PSKey.Yellow = cTID('Ylw ');
  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.selectionModifier = sTID('selectionModifier');
  PSString.selectionModifierType = sTID('selectionModifierType');
  PSString.solidColorLayer = sTID('solidColorLayer');
  PSType.BlendMode = cTID('BlnM');
  PSType.CorrectionMethod = cTID('CrcM');
  PSType.Ordinal = cTID('Ordn');
  PSUnit.Percent = cTID('#Prc');
};

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



//=========================================
//                    G1.main
//=========================================
//

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

G1.main();

// EOF

    },
};

$._ext_G2={
    run : function() {
//
// Generated Thu Aug 20 2015 16:05:45 GMT+0400
//

//
//==================== G2 ==============
//
function G2() {
  // 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.AdjustmentLayer);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    desc2.putString(PSKey.Name, "Colorize White G2");
    var desc3 = new ActionDescriptor();
    desc3.putEnumerated(PSString.presetKind, PSString.presetKindType, PSString.presetKindDefault);
    desc2.putObject(PSKey.Type, PSClass.SelectiveColor, desc3);
    desc1.putObject(PSKey.Using, PSClass.AdjustmentLayer, 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.AdjustmentLayer, PSType.Ordinal, PSEnum.Target);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    var list1 = new ActionList();
    var desc3 = new ActionDescriptor();
    desc3.putEnumerated(PSKey.Colors, PSKey.Colors, PSEnum.Whites);
    desc3.putUnitDouble(PSKey.Yellow, PSUnit.Percent, 50);
    list1.putObject(PSClass.ColorCorrection, desc3);
    desc2.putList(PSClass.ColorCorrection, list1);
    desc1.putObject(PSKey.To, PSClass.SelectiveColor, desc2);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

  // Make
  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.putClass(PSClass.AdjustmentLayer);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    desc2.putString(PSKey.Name, "Colorize All G2");
    var desc3 = new ActionDescriptor();
    var list1 = new ActionList();
    list1.putInteger(0);
    list1.putInteger(sTID("skinTone"), 0);
    list1.putInteger(sTID("contentAware"), 0);
    desc3.putList(PSKey.ShadowLevels, list1);
    var list2 = new ActionList();
    list2.putInteger(0);
    list2.putInteger(sTID("skinTone"), 0);
    list2.putInteger(sTID("contentAware"), 0);
    desc3.putList(PSKey.MidtoneLevels, list2);
    var list3 = new ActionList();
    list3.putInteger(0);
    list3.putInteger(sTID("skinTone"), 0);
    list3.putInteger(sTID("contentAware"), 0);
    desc3.putList(PSKey.HighlightLevels, list3);
    desc3.putBoolean(PSKey.PreserveLuminosity, true);
    desc2.putObject(PSKey.Type, PSClass.ColorBalance, desc3);
    desc1.putObject(PSKey.Using, PSClass.AdjustmentLayer, desc2);
    executeAction(PSEvent.Make, desc1, dialogMode);
  };

  // Set
  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.AdjustmentLayer, PSType.Ordinal, PSEnum.Target);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    var list1 = new ActionList();
    list1.putInteger(5);
    list1.putInteger(sTID("skinTone"), 0);
    list1.putInteger(sTID("contentAware"), 5);
    desc2.putList(PSKey.ShadowLevels, list1);
    var list2 = new ActionList();
    list2.putInteger(5);
    list2.putInteger(sTID("skinTone"), 0);
    list2.putInteger(sTID("contentAware"), -10);
    desc2.putList(PSKey.MidtoneLevels, list2);
    var list3 = new ActionList();
    list3.putInteger(5);
    list3.putInteger(sTID("skinTone"), 0);
    list3.putInteger(sTID("contentAware"), -10);
    desc2.putList(PSKey.HighlightLevels, list3);
    desc1.putObject(PSKey.To, PSClass.ColorBalance, desc2);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

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

  // Make
  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.AdjustmentLayer);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    desc2.putString(PSKey.Name, "Grading Map G2");
    var desc3 = new ActionDescriptor();
    var desc4 = new ActionDescriptor();
    desc4.putString(PSKey.Name, "Foreground to Background");
    desc4.putEnumerated(PSType.GradientForm, PSType.GradientForm, PSEnum.CustomStops);
    desc4.putDouble(PSKey.Interpolation, 4096);
    var list1 = new ActionList();
    var desc5 = new ActionDescriptor();
    var desc6 = new ActionDescriptor();
    desc6.putDouble(PSKey.Red, 19.9996948242188);
    desc6.putDouble(PSKey.Green, 11.9998168945313);
    desc6.putDouble(PSKey.Blue, 9.00375366210938);
    desc5.putObject(PSClass.Color, PSClass.RGBColor, desc6);
    desc5.putEnumerated(PSKey.Type, PSType.ColorStopType, PSEnum.UserStop);
    desc5.putInteger(PSKey.Location, 0);
    desc5.putInteger(PSKey.Midpoint, 50);
    list1.putObject(PSClass.ColorStop, desc5);
    var desc7 = new ActionDescriptor();
    var desc8 = new ActionDescriptor();
    desc8.putDouble(PSKey.Red, 0);
    desc8.putDouble(PSKey.Green, 0);
    desc8.putDouble(PSKey.Blue, 0);
    desc7.putObject(PSClass.Color, PSClass.RGBColor, desc8);
    desc7.putEnumerated(PSKey.Type, PSType.ColorStopType, PSEnum.UserStop);
    desc7.putInteger(PSKey.Location, 4096);
    desc7.putInteger(PSKey.Midpoint, 50);
    list1.putObject(PSClass.ColorStop, desc7);
    desc4.putList(PSKey.Colors, list1);
    var list2 = new ActionList();
    var desc9 = new ActionDescriptor();
    desc9.putUnitDouble(PSKey.Opacity, PSUnit.Percent, 100);
    desc9.putInteger(PSKey.Location, 0);
    desc9.putInteger(PSKey.Midpoint, 50);
    list2.putObject(PSClass.TransparencyStop, desc9);
    var desc10 = new ActionDescriptor();
    desc10.putUnitDouble(PSKey.Opacity, PSUnit.Percent, 100);
    desc10.putInteger(PSKey.Location, 4096);
    desc10.putInteger(PSKey.Midpoint, 50);
    list2.putObject(PSClass.TransparencyStop, desc10);
    desc4.putList(PSKey.Transparency, list2);
    desc3.putObject(PSKey.Gradient, PSClass.Gradient, desc4);
    desc2.putObject(PSKey.Type, PSClass.GradientMap, desc3);
    desc1.putObject(PSKey.Using, PSClass.AdjustmentLayer, desc2);
    executeAction(PSEvent.Make, 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.AdjustmentLayer, PSType.Ordinal, PSEnum.Target);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    var desc3 = new ActionDescriptor();
    desc3.putString(PSKey.Name, "Custom");
    desc3.putEnumerated(PSType.GradientForm, PSType.GradientForm, PSEnum.CustomStops);
    desc3.putDouble(PSKey.Interpolation, 4096);
    var list1 = new ActionList();
    var desc4 = new ActionDescriptor();
    var desc5 = new ActionDescriptor();
    desc5.putDouble(PSKey.Red, 3.00384521484375);
    desc5.putDouble(PSKey.Green, 3.00384521484375);
    desc5.putDouble(PSKey.Blue, 3.00384521484375);
    desc4.putObject(PSClass.Color, PSClass.RGBColor, desc5);
    desc4.putEnumerated(PSKey.Type, PSType.ColorStopType, PSEnum.UserStop);
    desc4.putInteger(PSKey.Location, 0);
    desc4.putInteger(PSKey.Midpoint, 50);
    list1.putObject(PSClass.ColorStop, desc4);
    var desc6 = new ActionDescriptor();
    var desc7 = new ActionDescriptor();
    desc7.putDouble(PSKey.Red, 19.4705200195313);
    desc7.putDouble(PSKey.Green, 24.4976806640625);
    desc7.putDouble(PSKey.Blue, 24.093017578125);
    desc6.putObject(PSClass.Color, PSClass.RGBColor, desc7);
    desc6.putEnumerated(PSKey.Type, PSType.ColorStopType, PSEnum.UserStop);
    desc6.putInteger(PSKey.Location, 62);
    desc6.putInteger(PSKey.Midpoint, 50);
    list1.putObject(PSClass.ColorStop, desc6);
    var desc8 = new ActionDescriptor();
    var desc9 = new ActionDescriptor();
    desc9.putDouble(PSKey.Red, 45.5868530273438);
    desc9.putDouble(PSKey.Green, 89.4227600097656);
    desc9.putDouble(PSKey.Blue, 122.651824951172);
    desc8.putObject(PSClass.Color, PSClass.RGBColor, desc9);
    desc8.putEnumerated(PSKey.Type, PSType.ColorStopType, PSEnum.UserStop);
    desc8.putInteger(PSKey.Location, 645);
    desc8.putInteger(PSKey.Midpoint, 50);
    list1.putObject(PSClass.ColorStop, desc8);
    var desc10 = new ActionDescriptor();
    var desc11 = new ActionDescriptor();
    desc11.putDouble(PSKey.Red, 127.998046875);
    desc11.putDouble(PSKey.Green, 127.998046875);
    desc11.putDouble(PSKey.Blue, 127.998046875);
    desc10.putObject(PSClass.Color, PSClass.RGBColor, desc11);
    desc10.putEnumerated(PSKey.Type, PSType.ColorStopType, PSEnum.UserStop);
    desc10.putInteger(PSKey.Location, 1131);
    desc10.putInteger(PSKey.Midpoint, 50);
    list1.putObject(PSClass.ColorStop, desc10);
    var desc12 = new ActionDescriptor();
    var desc13 = new ActionDescriptor();
    desc13.putDouble(PSKey.Red, 216.580352783203);
    desc13.putDouble(PSKey.Green, 189.358978271484);
    desc13.putDouble(PSKey.Blue, 128.542785644531);
    desc12.putObject(PSClass.Color, PSClass.RGBColor, desc13);
    desc12.putEnumerated(PSKey.Type, PSType.ColorStopType, PSEnum.UserStop);
    desc12.putInteger(PSKey.Location, 3090);
    desc12.putInteger(PSKey.Midpoint, 38);
    list1.putObject(PSClass.ColorStop, desc12);
    var desc14 = new ActionDescriptor();
    var desc15 = new ActionDescriptor();
    desc15.putDouble(PSKey.Red, 242.517700195313);
    desc15.putDouble(PSKey.Green, 236.517791748047);
    desc15.putDouble(PSKey.Blue, 200.518341064453);
    desc14.putObject(PSClass.Color, PSClass.RGBColor, desc15);
    desc14.putEnumerated(PSKey.Type, PSType.ColorStopType, PSEnum.UserStop);
    desc14.putInteger(PSKey.Location, 4024);
    desc14.putInteger(PSKey.Midpoint, 50);
    list1.putObject(PSClass.ColorStop, desc14);
    var desc16 = new ActionDescriptor();
    var desc17 = new ActionDescriptor();
    desc17.putDouble(PSKey.Red, 255);
    desc17.putDouble(PSKey.Green, 255);
    desc17.putDouble(PSKey.Blue, 255);
    desc16.putObject(PSClass.Color, PSClass.RGBColor, desc17);
    desc16.putEnumerated(PSKey.Type, PSType.ColorStopType, PSEnum.UserStop);
    desc16.putInteger(PSKey.Location, 4096);
    desc16.putInteger(PSKey.Midpoint, 50);
    list1.putObject(PSClass.ColorStop, desc16);
    desc3.putList(PSKey.Colors, list1);
    var list2 = new ActionList();
    var desc18 = new ActionDescriptor();
    desc18.putUnitDouble(PSKey.Opacity, PSUnit.Percent, 100);
    desc18.putInteger(PSKey.Location, 0);
    desc18.putInteger(PSKey.Midpoint, 50);
    list2.putObject(PSClass.TransparencyStop, desc18);
    var desc19 = new ActionDescriptor();
    desc19.putUnitDouble(PSKey.Opacity, PSUnit.Percent, 100);
    desc19.putInteger(PSKey.Location, 4096);
    desc19.putInteger(PSKey.Midpoint, 50);
    list2.putObject(PSClass.TransparencyStop, desc19);
    desc3.putList(PSKey.Transparency, list2);
    desc2.putObject(PSKey.Gradient, PSClass.Gradient, desc3);
    desc1.putObject(PSKey.To, PSClass.GradientMap, desc2);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

  // Set
  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.putEnumerated(PSKey.Mode, PSType.BlendMode, PSClass.Color);
    desc1.putObject(PSKey.To, PSClass.Layer, desc2);
    executeAction(PSEvent.Set, 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.putUnitDouble(PSKey.Opacity, PSUnit.Percent, 50);
    desc1.putObject(PSKey.To, PSClass.Layer, desc2);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

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

  // Make
  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.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);
  };

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

  step1();      // Make
  step2();      // Set
  step3();      // Make
  step4();      // Set
  step5();      // Set
  step6();      // Make
  step7();      // Set
  step8();      // Set
  step9();      // Set
  step10();      // Select
  step11();      // Make
  step12();      // Set
};



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

//
// G2.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.
//
G2.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.Color = cTID('Clr ');
  PSClass.ColorBalance = cTID('ClrB');
  PSClass.ColorCorrection = cTID('ClrC');
  PSClass.ColorStop = cTID('Clrt');
  PSClass.Gradient = cTID('Grdn');
  PSClass.GradientMap = cTID('GdMp');
  PSClass.Layer = cTID('Lyr ');
  PSClass.RGBColor = cTID('RGBC');
  PSClass.SelectiveColor = cTID('SlcC');
  PSClass.TransparencyStop = cTID('TrnS');
  PSEnum.CustomStops = cTID('CstS');
  PSEnum.Relative = cTID('Rltv');
  PSEnum.SoftLight = cTID('SftL');
  PSEnum.Target = cTID('Trgt');
  PSEnum.UserStop = cTID('UsrS');
  PSEnum.Whites = cTID('Whts');
  PSEvent.Make = cTID('Mk  ');
  PSEvent.Select = cTID('slct');
  PSEvent.Set = cTID('setd');
  PSKey.Black = cTID('Blck');
  PSKey.Blue = cTID('Bl  ');
  PSKey.Colors = cTID('Clrs');
  PSKey.Cyan = cTID('Cyn ');
  PSKey.From = cTID('From');
  PSKey.Gradient = cTID('Grad');
  PSKey.Green = cTID('Grn ');
  PSKey.HighlightLevels = cTID('HghL');
  PSKey.Interpolation = cTID('Intr');
  PSKey.Location = cTID('Lctn');
  PSKey.MakeVisible = cTID('MkVs');
  PSKey.Method = cTID('Mthd');
  PSKey.Midpoint = cTID('Mdpn');
  PSKey.MidtoneLevels = cTID('MdtL');
  PSKey.Mode = cTID('Md  ');
  PSKey.Name = cTID('Nm  ');
  PSKey.Opacity = cTID('Opct');
  PSKey.PreserveLuminosity = cTID('PrsL');
  PSKey.Red = cTID('Rd  ');
  PSKey.ShadowLevels = cTID('ShdL');
  PSKey.To = cTID('T   ');
  PSKey.Transparency = cTID('Trns');
  PSKey.Type = cTID('Type');
  PSKey.Using = cTID('Usng');
  PSKey.Yellow = cTID('Ylw ');
  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.selectionModifier = sTID('selectionModifier');
  PSString.selectionModifierType = sTID('selectionModifierType');
  PSString.solidColorLayer = sTID('solidColorLayer');
  PSType.BlendMode = cTID('BlnM');
  PSType.ColorStopType = cTID('Clry');
  PSType.CorrectionMethod = cTID('CrcM');
  PSType.GradientForm = cTID('GrdF');
  PSType.Ordinal = cTID('Ordn');
  PSUnit.Percent = cTID('#Prc');
};

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



//=========================================
//                    G2.main
//=========================================
//

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

G2.main();

// EOF

    },
};

$._ext_G3={
    run : function() {
//
// Generated Thu Aug 20 2015 16:28:57 GMT+0400
//

//
//==================== G3 ==============
//
function G3() {
  // Ñäåëàòü
  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.AdjustmentLayer);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    desc2.putString(PSKey.Name, "Colorize White G3");
    var desc3 = new ActionDescriptor();
    desc3.putEnumerated(PSString.presetKind, PSString.presetKindType, PSString.presetKindDefault);
    desc2.putObject(PSKey.Type, PSClass.SelectiveColor, desc3);
    desc1.putObject(PSKey.Using, PSClass.AdjustmentLayer, desc2);
    executeAction(sTID('make'), desc1, dialogMode);
  };

  // Çàäàòü
  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.AdjustmentLayer, PSType.Ordinal, PSEnum.Target);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    var list1 = new ActionList();
    var desc3 = new ActionDescriptor();
    desc3.putEnumerated(PSKey.Colors, PSKey.Colors, PSEnum.Whites);
    desc3.putUnitDouble(PSKey.Yellow, PSUnit.Percent, 50);
    list1.putObject(PSClass.ColorCorrection, desc3);
    desc2.putList(PSClass.ColorCorrection, list1);
    desc1.putObject(PSKey.To, PSClass.SelectiveColor, desc2);
    executeAction(sTID('set'), 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.putClass(PSClass.AdjustmentLayer);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    desc2.putString(PSKey.Name, "Colorize All G3");
    var desc3 = new ActionDescriptor();
    var list1 = new ActionList();
    list1.putInteger(0);
    list1.putInteger(sTID("skinTone"), 0);
    list1.putInteger(sTID("contentAware"), 0);
    desc3.putList(PSKey.ShadowLevels, list1);
    var list2 = new ActionList();
    list2.putInteger(0);
    list2.putInteger(sTID("skinTone"), 0);
    list2.putInteger(sTID("contentAware"), 0);
    desc3.putList(PSKey.MidtoneLevels, list2);
    var list3 = new ActionList();
    list3.putInteger(0);
    list3.putInteger(sTID("skinTone"), 0);
    list3.putInteger(sTID("contentAware"), 0);
    desc3.putList(PSKey.HighlightLevels, list3);
    desc3.putBoolean(PSKey.PreserveLuminosity, true);
    desc2.putObject(PSKey.Type, PSClass.ColorBalance, desc3);
    desc1.putObject(PSKey.Using, PSClass.AdjustmentLayer, desc2);
    executeAction(sTID('make'), 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.AdjustmentLayer, PSType.Ordinal, PSEnum.Target);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    var list1 = new ActionList();
    list1.putInteger(5);
    list1.putInteger(sTID("skinTone"), 0);
    list1.putInteger(sTID("contentAware"), 5);
    desc2.putList(PSKey.ShadowLevels, list1);
    var list2 = new ActionList();
    list2.putInteger(5);
    list2.putInteger(sTID("skinTone"), 0);
    list2.putInteger(sTID("contentAware"), -10);
    desc2.putList(PSKey.MidtoneLevels, list2);
    var list3 = new ActionList();
    list3.putInteger(5);
    list3.putInteger(sTID("skinTone"), 0);
    list3.putInteger(sTID("contentAware"), -10);
    desc2.putList(PSKey.HighlightLevels, list3);
    desc1.putObject(PSKey.To, PSClass.ColorBalance, desc2);
    executeAction(sTID('set'), desc1, 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.putEnumerated(PSKey.Mode, PSType.BlendMode, PSClass.Color);
    desc1.putObject(PSKey.To, PSClass.Layer, desc2);
    executeAction(sTID('set'), 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.AdjustmentLayer);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    desc2.putString(PSKey.Name, "Grading Map G3");
    var desc3 = new ActionDescriptor();
    var desc4 = new ActionDescriptor();
    desc4.putString(PSKey.Name, "Foreground to Background");
    desc4.putEnumerated(PSType.GradientForm, PSType.GradientForm, PSEnum.CustomStops);
    desc4.putDouble(PSKey.Interpolation, 4096);
    var list1 = new ActionList();
    var desc5 = new ActionDescriptor();
    var desc6 = new ActionDescriptor();
    desc6.putDouble(PSKey.Red, 19.9996948242188);
    desc6.putDouble(PSKey.Green, 11.9998168945313);
    desc6.putDouble(PSKey.Blue, 9.00375366210938);
    desc5.putObject(PSClass.Color, PSClass.RGBColor, desc6);
    desc5.putEnumerated(PSKey.Type, PSType.ColorStopType, PSEnum.UserStop);
    desc5.putInteger(PSKey.Location, 0);
    desc5.putInteger(PSKey.Midpoint, 50);
    list1.putObject(PSClass.ColorStop, desc5);
    var desc7 = new ActionDescriptor();
    var desc8 = new ActionDescriptor();
    desc8.putDouble(PSKey.Red, 0);
    desc8.putDouble(PSKey.Green, 0);
    desc8.putDouble(PSKey.Blue, 0);
    desc7.putObject(PSClass.Color, PSClass.RGBColor, desc8);
    desc7.putEnumerated(PSKey.Type, PSType.ColorStopType, PSEnum.UserStop);
    desc7.putInteger(PSKey.Location, 4096);
    desc7.putInteger(PSKey.Midpoint, 50);
    list1.putObject(PSClass.ColorStop, desc7);
    desc4.putList(PSKey.Colors, list1);
    var list2 = new ActionList();
    var desc9 = new ActionDescriptor();
    desc9.putUnitDouble(PSKey.Opacity, PSUnit.Percent, 100);
    desc9.putInteger(PSKey.Location, 0);
    desc9.putInteger(PSKey.Midpoint, 50);
    list2.putObject(PSClass.TransparencyStop, desc9);
    var desc10 = new ActionDescriptor();
    desc10.putUnitDouble(PSKey.Opacity, PSUnit.Percent, 100);
    desc10.putInteger(PSKey.Location, 4096);
    desc10.putInteger(PSKey.Midpoint, 50);
    list2.putObject(PSClass.TransparencyStop, desc10);
    desc4.putList(PSKey.Transparency, list2);
    desc3.putObject(PSKey.Gradient, PSClass.Gradient, desc4);
    desc2.putObject(PSKey.Type, PSClass.GradientMap, desc3);
    desc1.putObject(PSKey.Using, PSClass.AdjustmentLayer, desc2);
    executeAction(sTID('make'), 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.putEnumerated(PSClass.AdjustmentLayer, PSType.Ordinal, PSEnum.Target);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    var desc3 = new ActionDescriptor();
    desc3.putString(PSKey.Name, "$$$/Presets/Gradients/Toning/Gold1=Gold 1");
    desc3.putEnumerated(PSType.GradientForm, PSType.GradientForm, PSEnum.CustomStops);
    desc3.putDouble(PSKey.Interpolation, 4096);
    var list1 = new ActionList();
    var desc4 = new ActionDescriptor();
    var desc5 = new ActionDescriptor();
    desc5.putDouble(PSKey.Red, 3.00384521484375);
    desc5.putDouble(PSKey.Green, 3.00384521484375);
    desc5.putDouble(PSKey.Blue, 3.00384521484375);
    desc4.putObject(PSClass.Color, PSClass.RGBColor, desc5);
    desc4.putEnumerated(PSKey.Type, PSType.ColorStopType, PSEnum.UserStop);
    desc4.putInteger(PSKey.Location, 0);
    desc4.putInteger(PSKey.Midpoint, 50);
    list1.putObject(PSClass.ColorStop, desc4);
    var desc6 = new ActionDescriptor();
    var desc7 = new ActionDescriptor();
    desc7.putDouble(PSKey.Red, 69.5787048339844);
    desc7.putDouble(PSKey.Green, 47.1510314941406);
    desc7.putDouble(PSKey.Blue, 31.4080810546875);
    desc6.putObject(PSClass.Color, PSClass.RGBColor, desc7);
    desc6.putEnumerated(PSKey.Type, PSType.ColorStopType, PSEnum.UserStop);
    desc6.putInteger(PSKey.Location, 62);
    desc6.putInteger(PSKey.Midpoint, 50);
    list1.putObject(PSClass.ColorStop, desc6);
    var desc8 = new ActionDescriptor();
    var desc9 = new ActionDescriptor();
    desc9.putDouble(PSKey.Red, 90.8468627929688);
    desc9.putDouble(PSKey.Green, 59.6722412109375);
    desc9.putDouble(PSKey.Blue, 33.0422973632813);
    desc8.putObject(PSClass.Color, PSClass.RGBColor, desc9);
    desc8.putEnumerated(PSKey.Type, PSType.ColorStopType, PSEnum.UserStop);
    desc8.putInteger(PSKey.Location, 1037);
    desc8.putInteger(PSKey.Midpoint, 50);
    list1.putObject(PSClass.ColorStop, desc8);
    var desc10 = new ActionDescriptor();
    var desc11 = new ActionDescriptor();
    desc11.putDouble(PSKey.Red, 168.051910400391);
    desc11.putDouble(PSKey.Green, 130.713958740234);
    desc11.putDouble(PSKey.Blue, 71.2596130371094);
    desc10.putObject(PSClass.Color, PSClass.RGBColor, desc11);
    desc10.putEnumerated(PSKey.Type, PSType.ColorStopType, PSEnum.UserStop);
    desc10.putInteger(PSKey.Location, 2063);
    desc10.putInteger(PSKey.Midpoint, 50);
    list1.putObject(PSClass.ColorStop, desc10);
    var desc12 = new ActionDescriptor();
    var desc13 = new ActionDescriptor();
    desc13.putDouble(PSKey.Red, 217.413024902344);
    desc13.putDouble(PSKey.Green, 182.0361328125);
    desc13.putDouble(PSKey.Blue, 116.760864257813);
    desc12.putObject(PSClass.Color, PSClass.RGBColor, desc13);
    desc12.putEnumerated(PSKey.Type, PSType.ColorStopType, PSEnum.UserStop);
    desc12.putInteger(PSKey.Location, 3090);
    desc12.putInteger(PSKey.Midpoint, 50);
    list1.putObject(PSClass.ColorStop, desc12);
    var desc14 = new ActionDescriptor();
    var desc15 = new ActionDescriptor();
    desc15.putDouble(PSKey.Red, 251.972808837891);
    desc15.putDouble(PSKey.Green, 245.653839111328);
    desc15.putDouble(PSKey.Blue, 208.292541503906);
    desc14.putObject(PSClass.Color, PSClass.RGBColor, desc15);
    desc14.putEnumerated(PSKey.Type, PSType.ColorStopType, PSEnum.UserStop);
    desc14.putInteger(PSKey.Location, 4024);
    desc14.putInteger(PSKey.Midpoint, 50);
    list1.putObject(PSClass.ColorStop, desc14);
    var desc16 = new ActionDescriptor();
    var desc17 = new ActionDescriptor();
    desc17.putDouble(PSKey.Red, 255);
    desc17.putDouble(PSKey.Green, 255);
    desc17.putDouble(PSKey.Blue, 255);
    desc16.putObject(PSClass.Color, PSClass.RGBColor, desc17);
    desc16.putEnumerated(PSKey.Type, PSType.ColorStopType, PSEnum.UserStop);
    desc16.putInteger(PSKey.Location, 4096);
    desc16.putInteger(PSKey.Midpoint, 50);
    list1.putObject(PSClass.ColorStop, desc16);
    desc3.putList(PSKey.Colors, list1);
    var list2 = new ActionList();
    var desc18 = new ActionDescriptor();
    desc18.putUnitDouble(PSKey.Opacity, PSUnit.Percent, 100);
    desc18.putInteger(PSKey.Location, 0);
    desc18.putInteger(PSKey.Midpoint, 50);
    list2.putObject(PSClass.TransparencyStop, desc18);
    var desc19 = new ActionDescriptor();
    desc19.putUnitDouble(PSKey.Opacity, PSUnit.Percent, 100);
    desc19.putInteger(PSKey.Location, 4096);
    desc19.putInteger(PSKey.Midpoint, 50);
    list2.putObject(PSClass.TransparencyStop, desc19);
    desc3.putList(PSKey.Transparency, list2);
    desc2.putObject(PSKey.Gradient, PSClass.Gradient, desc3);
    desc1.putObject(PSKey.To, PSClass.GradientMap, desc2);
    executeAction(sTID('set'), 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.putEnumerated(PSKey.Mode, PSType.BlendMode, PSClass.Color);
    desc1.putObject(PSKey.To, PSClass.Layer, desc2);
    executeAction(sTID('set'), desc1, dialogMode);
  };

  // Çàäàòü
  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.putUnitDouble(PSKey.Opacity, PSUnit.Percent, 50);
    desc1.putObject(PSKey.To, PSClass.Layer, desc2);
    executeAction(sTID('set'), 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.putName(PSClass.Layer, "Colorize White G3");
    desc1.putReference(PSString.Null, ref1);
    desc1.putEnumerated(PSString.selectionModifier, PSString.selectionModifierType, PSString.addToSelectionContinuous);
    desc1.putBoolean(PSKey.MakeVisible, false);
    executeAction(sTID('select'), desc1, dialogMode);
  };

  // Ñäåëàòü
  function step11(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var desc1 = new ActionDescriptor();
    var ref1 = new ActionReference();
    ref1.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(sTID('make'), desc1, dialogMode);
  };

  // Çàäàòü
  function step12(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var desc1 = new ActionDescriptor();
    var ref1 = new ActionReference();
    ref1.putEnumerated(PSClass.Layer, PSType.Ordinal, PSEnum.Target);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    desc2.putString(PSKey.Name, "G3");
    desc1.putObject(PSKey.To, PSClass.Layer, desc2);
    executeAction(sTID('set'), desc1, dialogMode);
  };

  step1();      // Ñäåëàòü
  step2();      // Çàäàòü
  step3();      // Ñäåëàòü
  step4();      // Çàäàòü
  step5();      // Çàäàòü
  step6();      // Ñäåëàòü
  step7();      // Çàäàòü
  step8();      // Çàäàòü
  step9();      // Çàäàòü
  step10();      // Âûäåëåíèå
  step11();      // Ñäåëàòü
  step12();      // Çàäàòü
};



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

//
// G3.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.
//
G3.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.Color = cTID('Clr ');
  PSClass.ColorBalance = cTID('ClrB');
  PSClass.ColorCorrection = cTID('ClrC');
  PSClass.ColorStop = cTID('Clrt');
  PSClass.Gradient = cTID('Grdn');
  PSClass.GradientMap = cTID('GdMp');
  PSClass.Layer = cTID('Lyr ');
  PSClass.RGBColor = cTID('RGBC');
  PSClass.SelectiveColor = cTID('SlcC');
  PSClass.TransparencyStop = cTID('TrnS');
  PSEnum.CustomStops = cTID('CstS');
  PSEnum.Relative = cTID('Rltv');
  PSEnum.SoftLight = cTID('SftL');
  PSEnum.Target = cTID('Trgt');
  PSEnum.UserStop = cTID('UsrS');
  PSEnum.Whites = cTID('Whts');
  PSKey.Black = cTID('Blck');
  PSKey.Blue = cTID('Bl  ');
  PSKey.Colors = cTID('Clrs');
  PSKey.Cyan = cTID('Cyn ');
  PSKey.From = cTID('From');
  PSKey.Gradient = cTID('Grad');
  PSKey.Green = cTID('Grn ');
  PSKey.HighlightLevels = cTID('HghL');
  PSKey.Interpolation = cTID('Intr');
  PSKey.Location = cTID('Lctn');
  PSKey.MakeVisible = cTID('MkVs');
  PSKey.Method = cTID('Mthd');
  PSKey.Midpoint = cTID('Mdpn');
  PSKey.MidtoneLevels = cTID('MdtL');
  PSKey.Mode = cTID('Md  ');
  PSKey.Name = cTID('Nm  ');
  PSKey.Opacity = cTID('Opct');
  PSKey.PreserveLuminosity = cTID('PrsL');
  PSKey.Red = cTID('Rd  ');
  PSKey.ShadowLevels = cTID('ShdL');
  PSKey.To = cTID('T   ');
  PSKey.Transparency = cTID('Trns');
  PSKey.Type = cTID('Type');
  PSKey.Using = cTID('Usng');
  PSKey.Yellow = cTID('Ylw ');
  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.selectionModifier = sTID('selectionModifier');
  PSString.selectionModifierType = sTID('selectionModifierType');
  PSString.solidColorLayer = sTID('solidColorLayer');
  PSType.BlendMode = cTID('BlnM');
  PSType.ColorStopType = cTID('Clry');
  PSType.CorrectionMethod = cTID('CrcM');
  PSType.GradientForm = cTID('GrdF');
  PSType.Ordinal = cTID('Ordn');
  PSUnit.Percent = cTID('#Prc');
};

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



//=========================================
//                    G3.main
//=========================================
//

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

G3.main();

// EOF

    },
};

$._ext_J1={
    run : function() {
//
// Generated Thu Aug 20 2015 16:39:28 GMT+0400
//

//
//==================== J1 ==============
//
function J1() {
  // Ñäåëàòü
  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.AdjustmentLayer);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    desc2.putString(PSKey.Name, "SelectiveColor");
    var desc3 = new ActionDescriptor();
    desc3.putEnumerated(PSString.presetKind, PSString.presetKindType, PSString.presetKindDefault);
    desc2.putObject(PSKey.Type, PSClass.SelectiveColor, desc3);
    desc1.putObject(PSKey.Using, PSClass.AdjustmentLayer, desc2);
    executeAction(sTID('make'), desc1, dialogMode);
  };

  // Ïåðåìåùåíèå
  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 ref2 = new ActionReference();
    ref2.putEnumerated(PSClass.Layer, PSType.Ordinal, PSEnum.Front);
    desc1.putReference(PSKey.To, ref2);
    executeAction(sTID('move'), 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.AdjustmentLayer, PSType.Ordinal, PSEnum.Target);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    desc2.putEnumerated(PSString.presetKind, PSString.presetKindType, PSString.presetKindCustom);
    desc2.putEnumerated(PSKey.Method, PSType.CorrectionMethod, PSEnum.Absolute);
    var list1 = new ActionList();
    var desc3 = new ActionDescriptor();
    desc3.putEnumerated(PSKey.Colors, PSKey.Colors, PSEnum.Reds);
    desc3.putUnitDouble(PSKey.Black, PSUnit.Percent, -100);
    list1.putObject(PSClass.ColorCorrection, desc3);
    var desc4 = new ActionDescriptor();
    desc4.putEnumerated(PSKey.Colors, PSKey.Colors, PSEnum.Yellows);
    desc4.putUnitDouble(PSKey.Black, PSUnit.Percent, -100);
    list1.putObject(PSClass.ColorCorrection, desc4);
    var desc5 = new ActionDescriptor();
    desc5.putEnumerated(PSKey.Colors, PSKey.Colors, PSEnum.Greens);
    desc5.putUnitDouble(PSKey.Black, PSUnit.Percent, -100);
    list1.putObject(PSClass.ColorCorrection, desc5);
    var desc6 = new ActionDescriptor();
    desc6.putEnumerated(PSKey.Colors, PSKey.Colors, PSEnum.Cyans);
    desc6.putUnitDouble(PSKey.Black, PSUnit.Percent, -100);
    list1.putObject(PSClass.ColorCorrection, desc6);
    var desc7 = new ActionDescriptor();
    desc7.putEnumerated(PSKey.Colors, PSKey.Colors, PSEnum.Blues);
    desc7.putUnitDouble(PSKey.Black, PSUnit.Percent, -100);
    list1.putObject(PSClass.ColorCorrection, desc7);
    var desc8 = new ActionDescriptor();
    desc8.putEnumerated(PSKey.Colors, PSKey.Colors, PSEnum.Magentas);
    desc8.putUnitDouble(PSKey.Black, PSUnit.Percent, -100);
    list1.putObject(PSClass.ColorCorrection, desc8);
    var desc9 = new ActionDescriptor();
    desc9.putEnumerated(PSKey.Colors, PSKey.Colors, PSEnum.Whites);
    desc9.putUnitDouble(PSKey.Black, PSUnit.Percent, 100);
    list1.putObject(PSClass.ColorCorrection, desc9);
    var desc10 = new ActionDescriptor();
    desc10.putEnumerated(PSKey.Colors, PSKey.Colors, PSEnum.Neutrals);
    desc10.putUnitDouble(PSKey.Black, PSUnit.Percent, 100);
    list1.putObject(PSClass.ColorCorrection, desc10);
    var desc11 = new ActionDescriptor();
    desc11.putEnumerated(PSKey.Colors, PSKey.Colors, PSEnum.Blocks);
    desc11.putUnitDouble(PSKey.Black, PSUnit.Percent, 100);
    list1.putObject(PSClass.ColorCorrection, desc11);
    desc2.putList(PSClass.ColorCorrection, list1);
    desc1.putObject(PSKey.To, PSClass.SelectiveColor, desc2);
    executeAction(sTID('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.putClass(PSClass.AdjustmentLayer);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    desc2.putString(PSKey.Name, "ContrastForMask");
    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(sTID('make'), desc1, 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.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, 0);
    desc4.putDouble(PSKey.Vertical, 0);
    list2.putObject(PSClass.Point, desc4);
    var desc5 = new ActionDescriptor();
    desc5.putDouble(PSKey.Horizontal, 128);
    desc5.putDouble(PSKey.Vertical, 255);
    list2.putObject(PSClass.Point, desc5);
    desc3.putList(PSKey.Curve, list2);
    list1.putObject(PSClass.CurvesAdjustment, desc3);
    desc2.putList(PSKey.Adjustment, list1);
    desc1.putObject(PSKey.To, PSClass.Curves, desc2);
    executeAction(sTID('set'), 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(sTID('make'), 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.putEnumerated(PSClass.Layer, PSType.Ordinal, PSEnum.Target);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    desc2.putString(PSKey.Name, "Merged");
    desc1.putObject(PSKey.To, PSClass.Layer, desc2);
    executeAction(sTID('set'), desc1, dialogMode);
  };

  // Âíåøíèé êàíàë
  function step8(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);
    desc2.putEnumerated(PSKey.Calculation, PSType.Calculation, PSEnum.Multiply);
    desc1.putObject(PSKey.With, PSKey.Calculation, desc2);
    executeAction(sTID('applyImageEvent'), desc1, dialogMode);
  };

  // Âûäåëåíèå
  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.Backward);
    desc1.putReference(PSString.Null, ref1);
    desc1.putEnumerated(PSString.selectionModifier, PSString.selectionModifierType, PSString.addToSelection);
    desc1.putBoolean(PSKey.MakeVisible, false);
    executeAction(sTID('select'), 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.Backward);
    desc1.putReference(PSString.Null, ref1);
    desc1.putEnumerated(PSString.selectionModifier, PSString.selectionModifierType, PSString.addToSelection);
    desc1.putBoolean(PSKey.MakeVisible, false);
    executeAction(sTID('select'), desc1, dialogMode);
  };

  // Ñäåëàòü
  function step11(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var desc1 = new ActionDescriptor();
    var ref1 = new ActionReference();
    ref1.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(sTID('make'), desc1, dialogMode);
  };

  // Çàäàòü
  function step12(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var desc1 = new ActionDescriptor();
    var ref1 = new ActionReference();
    ref1.putEnumerated(PSClass.Layer, PSType.Ordinal, PSEnum.Target);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    desc2.putString(PSKey.Name, "Saturation Mask");
    desc1.putObject(PSKey.To, PSClass.Layer, desc2);
    executeAction(sTID('set'), 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.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSString.Null, ref1);
    var ref2 = new ActionReference();
    ref2.putEnumerated(PSClass.Channel, PSClass.Channel, PSEnum.RGB);
    desc1.putReference(PSKey.To, ref2);
    executeAction(sTID('set'), 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.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSString.Null, ref1);
    desc1.putString(PSKey.Name, "SaturnMask");
    executeAction(sTID('duplicate'), 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.putEnumerated(PSClass.Layer, PSType.Ordinal, PSEnum.Target);
    desc1.putReference(PSString.Null, ref1);
    executeAction(sTID('delete'), 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);
    desc1.putEnumerated(PSKey.To, PSType.Ordinal, PSEnum.None);
    executeAction(sTID('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.Channel, PSClass.Channel, PSEnum.RGB);
    desc1.putReference(PSString.Null, ref1);
    executeAction(sTID('select'), 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.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSString.Null, ref1);
    var ref2 = new ActionReference();
    ref2.putName(PSClass.Channel, "SaturnMask");
    desc1.putReference(PSKey.To, ref2);
    executeAction(sTID('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();
    desc2.putString(PSKey.Name, "Desaturate heavily saturated");
    desc2.putClass(PSKey.Type, sTID("vibrance"));
    desc1.putObject(PSKey.Using, PSClass.AdjustmentLayer, desc2);
    executeAction(sTID('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.Layer, PSType.Ordinal, PSEnum.Target);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    desc2.putUnitDouble(PSKey.Opacity, PSUnit.Percent, 50);
    desc1.putObject(PSKey.To, PSClass.Layer, desc2);
    executeAction(sTID('set'), 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.AdjustmentLayer, PSType.Ordinal, PSEnum.Target);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    desc2.putInteger(PSKey.Start, -50);
    desc1.putObject(PSKey.To, sTID("vibrance"), desc2);
    executeAction(sTID('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.putName(PSClass.Channel, "SaturnMask");
    desc1.putReference(PSString.Null, ref1);
    executeAction(sTID('delete'), 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.Layer, PSType.Ordinal, PSEnum.Target);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    desc2.putString(PSKey.Name, "Desaturate heavily saturated C1");
    desc1.putObject(PSKey.To, PSClass.Layer, desc2);
    executeAction(sTID('set'), 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.putClass(PSString.contentLayer);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    desc2.putString(PSKey.Name, "Exclusion grading");
    var desc3 = new ActionDescriptor();
    var desc4 = new ActionDescriptor();
    desc4.putDouble(PSKey.Red, 12.7159530669451);
    desc4.putDouble(PSKey.Green, 88.1867699325085);
    desc4.putDouble(PSKey.Blue, 141.00000679493);
    desc3.putObject(PSKey.Color, PSClass.RGBColor, desc4);
    desc2.putObject(PSKey.Type, PSString.solidColorLayer, desc3);
    desc1.putObject(PSKey.Using, PSString.contentLayer, desc2);
    executeAction(sTID('make'), 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);
    var desc2 = new ActionDescriptor();
    desc2.putEnumerated(PSKey.Mode, PSType.BlendMode, PSEnum.Exclusion);
    desc1.putObject(PSKey.To, PSClass.Layer, desc2);
    executeAction(sTID('set'), desc1, dialogMode);
  };

  // Çàäàòü
  function step26(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var desc1 = new ActionDescriptor();
    var ref1 = new ActionReference();
    ref1.putEnumerated(PSClass.Layer, PSType.Ordinal, PSEnum.Target);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    desc2.putUnitDouble(PSKey.Opacity, PSUnit.Percent, 20);
    desc1.putObject(PSKey.To, PSClass.Layer, desc2);
    executeAction(sTID('set'), 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.putEnumerated(PSClass.Layer, PSType.Ordinal, PSEnum.Target);
    desc1.putReference(PSString.Null, ref1);
    var ref2 = new ActionReference();
    ref2.putEnumerated(PSClass.Layer, PSType.Ordinal, PSEnum.Front);
    desc1.putReference(PSKey.To, ref2);
    executeAction(sTID('move'), 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, "Exclusion grading C1");
    desc1.putObject(PSKey.To, PSClass.Layer, desc2);
    executeAction(sTID('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.putClass(PSString.contentLayer);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    desc2.putString(PSKey.Name, "Desaturation C1");
    var desc3 = new ActionDescriptor();
    var desc4 = new ActionDescriptor();
    desc4.putDouble(PSKey.Red, 127.501945495605);
    desc4.putDouble(PSKey.Green, 127.501945495605);
    desc4.putDouble(PSKey.Blue, 127.501945495605);
    desc3.putObject(PSKey.Color, PSClass.RGBColor, desc4);
    desc2.putObject(PSKey.Type, PSString.solidColorLayer, desc3);
    desc1.putObject(PSKey.Using, PSString.contentLayer, desc2);
    executeAction(sTID('make'), desc1, dialogMode);
  };

  // Çàäàòü
  function step30(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var desc1 = new ActionDescriptor();
    var ref1 = new ActionReference();
    ref1.putEnumerated(PSClass.Layer, PSType.Ordinal, PSEnum.Target);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    desc2.putEnumerated(PSKey.Mode, PSType.BlendMode, PSKey.Color);
    desc1.putObject(PSKey.To, PSClass.Layer, desc2);
    executeAction(sTID('set'), desc1, dialogMode);
  };

  // Çàäàòü
  function step31(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var desc1 = new ActionDescriptor();
    var ref1 = new ActionReference();
    ref1.putEnumerated(PSClass.Layer, PSType.Ordinal, PSEnum.Target);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    desc2.putUnitDouble(PSKey.Opacity, PSUnit.Percent, 15);
    desc1.putObject(PSKey.To, PSClass.Layer, desc2);
    executeAction(sTID('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.putEnumerated(PSClass.Layer, PSType.Ordinal, PSEnum.Target);
    desc1.putReference(PSString.Null, ref1);
    var ref2 = new ActionReference();
    ref2.putEnumerated(PSClass.Layer, PSType.Ordinal, PSEnum.Previous);
    desc1.putReference(PSKey.To, ref2);
    executeAction(sTID('move'), 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.Forward);
    desc1.putReference(PSString.Null, ref1);
    desc1.putBoolean(PSKey.MakeVisible, false);
    executeAction(sTID('select'), 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.Backward);
    desc1.putReference(PSString.Null, ref1);
    desc1.putEnumerated(PSString.selectionModifier, PSString.selectionModifierType, PSString.addToSelection);
    desc1.putBoolean(PSKey.MakeVisible, false);
    executeAction(sTID('select'), 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.putEnumerated(PSClass.Layer, PSType.Ordinal, PSEnum.Backward);
    desc1.putReference(PSString.Null, ref1);
    desc1.putEnumerated(PSString.selectionModifier, PSString.selectionModifierType, PSString.addToSelection);
    desc1.putBoolean(PSKey.MakeVisible, false);
    executeAction(sTID('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.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(sTID('make'), 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, "J1");
    desc1.putObject(PSKey.To, PSClass.Layer, desc2);
    executeAction(sTID('set'), desc1, dialogMode);
  };

  step1();      // Ñäåëàòü
  step2();      // Ïåðåìåùåíèå
  step3();      // Çàäàòü
  step4();      // Ñäåëàòü
  step5();      // Çàäàòü
  step6();      // Ñäåëàòü
  step7();      // Çàäàòü
  step8();      // Âíåøíèé êàíàë
  step9();      // Âûäåëåíèå
  step10();      // Âûäåëåíèå
  step11();      // Ñäåëàòü
  step12();      // Çàäàòü
  step13();      // Çàäàòü
  step14();      // Ñîçäàòü äóáëèêàò
  step15();      // Óäàëèòü
  step16();      // Çàäàòü
  step17();      // Âûäåëåíèå
  step18();      // Çàäàòü
  step19();      // Ñäåëàòü
  step20();      // Çàäàòü
  step21();      // Çàäàòü
  step22();      // Óäàëèòü
  step23();      // Çàäàòü
  step24();      // Ñäåëàòü
  step25();      // Çàäàòü
  step26();      // Çàäàòü
  step27();      // Ïåðåìåùåíèå
  step28();      // Çàäàòü
  step29();      // Ñäåëàòü
  step30();      // Çàäàòü
  step31();      // Çàäàòü
  step32();      // Ïåðåìåùåíèå
  step33();      // Âûäåëåíèå
  step34();      // Âûäåëåíèå
  step35();      // Âûäåëåíèå
  step36();      // Ñäåëàòü
  step37();      // Çàäàòü
};



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

//
// J1.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.
//
J1.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.ColorCorrection = cTID('ClrC');
  PSClass.Curves = cTID('Crvs');
  PSClass.CurvesAdjustment = cTID('CrvA');
  PSClass.Layer = cTID('Lyr ');
  PSClass.Point = cTID('Pnt ');
  PSClass.RGBColor = cTID('RGBC');
  PSClass.SelectiveColor = cTID('SlcC');
  PSEnum.Absolute = cTID('Absl');
  PSEnum.Backward = cTID('Bckw');
  PSEnum.Blocks = cTID('Blks');
  PSEnum.Blues = cTID('Bls ');
  PSEnum.Composite = cTID('Cmps');
  PSEnum.Cyans = cTID('Cyns');
  PSEnum.Exclusion = cTID('Xclu');
  PSEnum.Forward = cTID('Frwr');
  PSEnum.Front = cTID('Frnt');
  PSEnum.Greens = cTID('Grns');
  PSEnum.Magentas = cTID('Mgnt');
  PSEnum.Merged = cTID('Mrgd');
  PSEnum.Multiply = cTID('Mltp');
  PSEnum.Neutrals = cTID('Ntrl');
  PSEnum.None = cTID('None');
  PSEnum.Previous = cTID('Prvs');
  PSEnum.RGB = cTID('RGB ');
  PSEnum.Reds = cTID('Rds ');
  PSEnum.Target = cTID('Trgt');
  PSEnum.Whites = cTID('Whts');
  PSEnum.Yellows = cTID('Ylws');
  PSKey.Adjustment = cTID('Adjs');
  PSKey.Black = cTID('Blck');
  PSKey.Blue = cTID('Bl  ');
  PSKey.Calculation = cTID('Clcl');
  PSKey.Color = cTID('Clr ');
  PSKey.Colors = cTID('Clrs');
  PSKey.Curve = cTID('Crv ');
  PSKey.From = cTID('From');
  PSKey.Green = cTID('Grn ');
  PSKey.Horizontal = cTID('Hrzn');
  PSKey.MakeVisible = cTID('MkVs');
  PSKey.Method = cTID('Mthd');
  PSKey.Mode = cTID('Md  ');
  PSKey.Name = cTID('Nm  ');
  PSKey.Opacity = cTID('Opct');
  PSKey.Red = cTID('Rd  ');
  PSKey.Start = cTID('Strt');
  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.addToSelection = sTID('addToSelection');
  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.Calculation = cTID('Clcn');
  PSType.CorrectionMethod = cTID('CrcM');
  PSType.Ordinal = cTID('Ordn');
  PSUnit.Percent = cTID('#Prc');
};

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



//=========================================
//                    J1.main
//=========================================
//

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

J1.main();

// EOF

    },
};

$._ext_J2={
    run : function() {
//
// Generated Thu Aug 20 2015 16:28:44 GMT+0400
//

//
//==================== J2 ==============
//
function J2() {
  // Ñäåëàòü
  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.AdjustmentLayer);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    desc2.putString(PSKey.Name, "SelectiveColor");
    var desc3 = new ActionDescriptor();
    desc3.putEnumerated(PSString.presetKind, PSString.presetKindType, PSString.presetKindDefault);
    desc2.putObject(PSKey.Type, PSClass.SelectiveColor, desc3);
    desc1.putObject(PSKey.Using, PSClass.AdjustmentLayer, desc2);
    executeAction(sTID('make'), desc1, dialogMode);
  };

  // Ïåðåìåùåíèå
  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 ref2 = new ActionReference();
    ref2.putEnumerated(PSClass.Layer, PSType.Ordinal, PSEnum.Front);
    desc1.putReference(PSKey.To, ref2);
    executeAction(sTID('move'), 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.AdjustmentLayer, PSType.Ordinal, PSEnum.Target);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    desc2.putEnumerated(PSString.presetKind, PSString.presetKindType, PSString.presetKindCustom);
    desc2.putEnumerated(PSKey.Method, PSType.CorrectionMethod, PSEnum.Absolute);
    var list1 = new ActionList();
    var desc3 = new ActionDescriptor();
    desc3.putEnumerated(PSKey.Colors, PSKey.Colors, PSEnum.Reds);
    desc3.putUnitDouble(PSKey.Black, PSUnit.Percent, -100);
    list1.putObject(PSClass.ColorCorrection, desc3);
    var desc4 = new ActionDescriptor();
    desc4.putEnumerated(PSKey.Colors, PSKey.Colors, PSEnum.Yellows);
    desc4.putUnitDouble(PSKey.Black, PSUnit.Percent, -100);
    list1.putObject(PSClass.ColorCorrection, desc4);
    var desc5 = new ActionDescriptor();
    desc5.putEnumerated(PSKey.Colors, PSKey.Colors, PSEnum.Greens);
    desc5.putUnitDouble(PSKey.Black, PSUnit.Percent, -100);
    list1.putObject(PSClass.ColorCorrection, desc5);
    var desc6 = new ActionDescriptor();
    desc6.putEnumerated(PSKey.Colors, PSKey.Colors, PSEnum.Cyans);
    desc6.putUnitDouble(PSKey.Black, PSUnit.Percent, -100);
    list1.putObject(PSClass.ColorCorrection, desc6);
    var desc7 = new ActionDescriptor();
    desc7.putEnumerated(PSKey.Colors, PSKey.Colors, PSEnum.Blues);
    desc7.putUnitDouble(PSKey.Black, PSUnit.Percent, -100);
    list1.putObject(PSClass.ColorCorrection, desc7);
    var desc8 = new ActionDescriptor();
    desc8.putEnumerated(PSKey.Colors, PSKey.Colors, PSEnum.Magentas);
    desc8.putUnitDouble(PSKey.Black, PSUnit.Percent, -100);
    list1.putObject(PSClass.ColorCorrection, desc8);
    var desc9 = new ActionDescriptor();
    desc9.putEnumerated(PSKey.Colors, PSKey.Colors, PSEnum.Whites);
    desc9.putUnitDouble(PSKey.Black, PSUnit.Percent, 100);
    list1.putObject(PSClass.ColorCorrection, desc9);
    var desc10 = new ActionDescriptor();
    desc10.putEnumerated(PSKey.Colors, PSKey.Colors, PSEnum.Neutrals);
    desc10.putUnitDouble(PSKey.Black, PSUnit.Percent, 100);
    list1.putObject(PSClass.ColorCorrection, desc10);
    var desc11 = new ActionDescriptor();
    desc11.putEnumerated(PSKey.Colors, PSKey.Colors, PSEnum.Blocks);
    desc11.putUnitDouble(PSKey.Black, PSUnit.Percent, 100);
    list1.putObject(PSClass.ColorCorrection, desc11);
    desc2.putList(PSClass.ColorCorrection, list1);
    desc1.putObject(PSKey.To, PSClass.SelectiveColor, desc2);
    executeAction(sTID('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.putClass(PSClass.AdjustmentLayer);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    desc2.putString(PSKey.Name, "ContrastForMask");
    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(sTID('make'), desc1, 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.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, 0);
    desc4.putDouble(PSKey.Vertical, 0);
    list2.putObject(PSClass.Point, desc4);
    var desc5 = new ActionDescriptor();
    desc5.putDouble(PSKey.Horizontal, 128);
    desc5.putDouble(PSKey.Vertical, 255);
    list2.putObject(PSClass.Point, desc5);
    desc3.putList(PSKey.Curve, list2);
    list1.putObject(PSClass.CurvesAdjustment, desc3);
    desc2.putList(PSKey.Adjustment, list1);
    desc1.putObject(PSKey.To, PSClass.Curves, desc2);
    executeAction(sTID('set'), 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(sTID('make'), 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.putEnumerated(PSClass.Layer, PSType.Ordinal, PSEnum.Target);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    desc2.putString(PSKey.Name, "Merged");
    desc1.putObject(PSKey.To, PSClass.Layer, desc2);
    executeAction(sTID('set'), desc1, dialogMode);
  };

  // Âíåøíèé êàíàë
  function step8(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);
    desc2.putEnumerated(PSKey.Calculation, PSType.Calculation, PSEnum.Multiply);
    desc1.putObject(PSKey.With, PSKey.Calculation, desc2);
    executeAction(sTID('applyImageEvent'), desc1, dialogMode);
  };

  // Âûäåëåíèå
  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.Backward);
    desc1.putReference(PSString.Null, ref1);
    desc1.putEnumerated(PSString.selectionModifier, PSString.selectionModifierType, PSString.addToSelection);
    desc1.putBoolean(PSKey.MakeVisible, false);
    executeAction(sTID('select'), 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.Backward);
    desc1.putReference(PSString.Null, ref1);
    desc1.putEnumerated(PSString.selectionModifier, PSString.selectionModifierType, PSString.addToSelection);
    desc1.putBoolean(PSKey.MakeVisible, false);
    executeAction(sTID('select'), desc1, dialogMode);
  };

  // Ñäåëàòü
  function step11(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var desc1 = new ActionDescriptor();
    var ref1 = new ActionReference();
    ref1.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(sTID('make'), desc1, dialogMode);
  };

  // Çàäàòü
  function step12(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var desc1 = new ActionDescriptor();
    var ref1 = new ActionReference();
    ref1.putEnumerated(PSClass.Layer, PSType.Ordinal, PSEnum.Target);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    desc2.putString(PSKey.Name, "Saturation Mask");
    desc1.putObject(PSKey.To, PSClass.Layer, desc2);
    executeAction(sTID('set'), 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.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSString.Null, ref1);
    var ref2 = new ActionReference();
    ref2.putEnumerated(PSClass.Channel, PSClass.Channel, PSEnum.RGB);
    desc1.putReference(PSKey.To, ref2);
    executeAction(sTID('set'), 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.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSString.Null, ref1);
    desc1.putString(PSKey.Name, "SaturnMask");
    executeAction(sTID('duplicate'), 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.putEnumerated(PSClass.Layer, PSType.Ordinal, PSEnum.Target);
    desc1.putReference(PSString.Null, ref1);
    executeAction(sTID('delete'), 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);
    desc1.putEnumerated(PSKey.To, PSType.Ordinal, PSEnum.None);
    executeAction(sTID('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.Channel, PSClass.Channel, PSEnum.RGB);
    desc1.putReference(PSString.Null, ref1);
    executeAction(sTID('select'), 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.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSString.Null, ref1);
    var ref2 = new ActionReference();
    ref2.putName(PSClass.Channel, "SaturnMask");
    desc1.putReference(PSKey.To, ref2);
    executeAction(sTID('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();
    desc2.putString(PSKey.Name, "Desaturate heavily saturated");
    desc2.putClass(PSKey.Type, sTID("vibrance"));
    desc1.putObject(PSKey.Using, PSClass.AdjustmentLayer, desc2);
    executeAction(sTID('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.Layer, PSType.Ordinal, PSEnum.Target);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    desc2.putUnitDouble(PSKey.Opacity, PSUnit.Percent, 50);
    desc1.putObject(PSKey.To, PSClass.Layer, desc2);
    executeAction(sTID('set'), 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.AdjustmentLayer, PSType.Ordinal, PSEnum.Target);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    desc2.putInteger(PSKey.Start, -50);
    desc1.putObject(PSKey.To, sTID("vibrance"), desc2);
    executeAction(sTID('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.putName(PSClass.Channel, "SaturnMask");
    desc1.putReference(PSString.Null, ref1);
    executeAction(sTID('delete'), 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.Layer, PSType.Ordinal, PSEnum.Target);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    desc2.putString(PSKey.Name, "Desaturate heavily saturated C2");
    desc1.putObject(PSKey.To, PSClass.Layer, desc2);
    executeAction(sTID('set'), 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, "Desaturate heavily saturated C2");
    desc1.putObject(PSKey.To, PSClass.Layer, desc2);
    executeAction(sTID('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.putClass(PSClass.AdjustmentLayer);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    desc2.putString(PSKey.Name, "Grading C2");
    var desc3 = new ActionDescriptor();
    var desc4 = new ActionDescriptor();
    desc4.putString(PSKey.Name, "Foreground to Background");
    desc4.putEnumerated(PSType.GradientForm, PSType.GradientForm, PSEnum.CustomStops);
    desc4.putDouble(PSKey.Interpolation, 4096);
    var list1 = new ActionList();
    var desc5 = new ActionDescriptor();
    var desc6 = new ActionDescriptor();
    desc6.putDouble(PSKey.Red, 177.000004649162);
    desc6.putDouble(PSKey.Green, 187.9961130023);
    desc6.putDouble(PSKey.Blue, 187.9961130023);
    desc5.putObject(PSKey.Color, PSClass.RGBColor, desc6);
    desc5.putEnumerated(PSKey.Type, PSType.ColorStopType, PSEnum.UserStop);
    desc5.putInteger(PSKey.Location, 0);
    desc5.putInteger(PSKey.Midpoint, 50);
    list1.putObject(PSClass.ColorStop, desc5);
    var desc7 = new ActionDescriptor();
    var desc8 = new ActionDescriptor();
    desc8.putDouble(PSKey.Red, 0);
    desc8.putDouble(PSKey.Green, 0);
    desc8.putDouble(PSKey.Blue, 0);
    desc7.putObject(PSKey.Color, PSClass.RGBColor, desc8);
    desc7.putEnumerated(PSKey.Type, PSType.ColorStopType, PSEnum.UserStop);
    desc7.putInteger(PSKey.Location, 4096);
    desc7.putInteger(PSKey.Midpoint, 50);
    list1.putObject(PSClass.ColorStop, desc7);
    desc4.putList(PSKey.Colors, list1);
    var list2 = new ActionList();
    var desc9 = new ActionDescriptor();
    desc9.putUnitDouble(PSKey.Opacity, PSUnit.Percent, 100);
    desc9.putInteger(PSKey.Location, 0);
    desc9.putInteger(PSKey.Midpoint, 50);
    list2.putObject(PSClass.TransparencyStop, desc9);
    var desc10 = new ActionDescriptor();
    desc10.putUnitDouble(PSKey.Opacity, PSUnit.Percent, 100);
    desc10.putInteger(PSKey.Location, 4096);
    desc10.putInteger(PSKey.Midpoint, 50);
    list2.putObject(PSClass.TransparencyStop, desc10);
    desc4.putList(PSKey.Transparency, list2);
    desc3.putObject(PSKey.Gradient, PSClass.Gradient, desc4);
    desc2.putObject(PSKey.Type, PSClass.GradientMap, desc3);
    desc1.putObject(PSKey.Using, PSClass.AdjustmentLayer, desc2);
    executeAction(sTID('make'), desc1, dialogMode);
  };

  // Çàäàòü
  function step26(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var desc1 = new ActionDescriptor();
    var ref1 = new ActionReference();
    ref1.putEnumerated(PSClass.AdjustmentLayer, PSType.Ordinal, PSEnum.Target);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    var desc3 = new ActionDescriptor();
    desc3.putString(PSKey.Name, "Custom");
    desc3.putEnumerated(PSType.GradientForm, PSType.GradientForm, PSEnum.CustomStops);
    desc3.putDouble(PSKey.Interpolation, 4096);
    var list1 = new ActionList();
    var desc4 = new ActionDescriptor();
    var desc5 = new ActionDescriptor();
    desc5.putDouble(PSKey.Red, 42.9143956303597);
    desc5.putDouble(PSKey.Green, 9.81712091714144);
    desc5.putDouble(PSKey.Blue, 89.2490257322788);
    desc4.putObject(PSKey.Color, PSClass.RGBColor, desc5);
    desc4.putEnumerated(PSKey.Type, PSType.ColorStopType, PSEnum.UserStop);
    desc4.putInteger(PSKey.Location, 0);
    desc4.putInteger(PSKey.Midpoint, 50);
    list1.putObject(PSClass.ColorStop, desc4);
    var desc6 = new ActionDescriptor();
    var desc7 = new ActionDescriptor();
    desc7.putDouble(PSKey.Red, 255);
    desc7.putDouble(PSKey.Green, 127.494163513184);
    desc7.putDouble(PSKey.Blue, 0);
    desc6.putObject(PSKey.Color, PSClass.RGBColor, desc7);
    desc6.putEnumerated(PSKey.Type, PSType.ColorStopType, PSEnum.UserStop);
    desc6.putInteger(PSKey.Location, 4096);
    desc6.putInteger(PSKey.Midpoint, 50);
    list1.putObject(PSClass.ColorStop, desc6);
    desc3.putList(PSKey.Colors, list1);
    var list2 = new ActionList();
    var desc8 = new ActionDescriptor();
    desc8.putUnitDouble(PSKey.Opacity, PSUnit.Percent, 100);
    desc8.putInteger(PSKey.Location, 0);
    desc8.putInteger(PSKey.Midpoint, 50);
    list2.putObject(PSClass.TransparencyStop, desc8);
    var desc9 = new ActionDescriptor();
    desc9.putUnitDouble(PSKey.Opacity, PSUnit.Percent, 100);
    desc9.putInteger(PSKey.Location, 4096);
    desc9.putInteger(PSKey.Midpoint, 50);
    list2.putObject(PSClass.TransparencyStop, desc9);
    desc3.putList(PSKey.Transparency, list2);
    desc2.putObject(PSKey.Gradient, PSClass.Gradient, desc3);
    desc1.putObject(PSKey.To, PSClass.GradientMap, desc2);
    executeAction(sTID('set'), 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.putEnumerated(PSClass.Layer, PSType.Ordinal, PSEnum.Target);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    desc2.putUnitDouble(PSKey.Opacity, PSUnit.Percent, 20);
    desc1.putObject(PSKey.To, PSClass.Layer, desc2);
    executeAction(sTID('set'), 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 ref2 = new ActionReference();
    ref2.putEnumerated(PSClass.Layer, PSType.Ordinal, PSEnum.Front);
    desc1.putReference(PSKey.To, ref2);
    executeAction(sTID('move'), desc1, dialogMode);
  };

  // Ñäåëàòü
  function step29(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var desc1 = new ActionDescriptor();
    var ref1 = new ActionReference();
    ref1.putClass(PSString.contentLayer);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    desc2.putString(PSKey.Name, "Desaturation C2");
    var desc3 = new ActionDescriptor();
    var desc4 = new ActionDescriptor();
    desc4.putDouble(PSKey.Red, 127.501945495605);
    desc4.putDouble(PSKey.Green, 127.501945495605);
    desc4.putDouble(PSKey.Blue, 127.501945495605);
    desc3.putObject(PSKey.Color, PSClass.RGBColor, desc4);
    desc2.putObject(PSKey.Type, PSString.solidColorLayer, desc3);
    desc1.putObject(PSKey.Using, PSString.contentLayer, desc2);
    executeAction(sTID('make'), desc1, dialogMode);
  };

  // Çàäàòü
  function step30(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var desc1 = new ActionDescriptor();
    var ref1 = new ActionReference();
    ref1.putEnumerated(PSClass.Layer, PSType.Ordinal, PSEnum.Target);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    desc2.putEnumerated(PSKey.Mode, PSType.BlendMode, PSKey.Color);
    desc1.putObject(PSKey.To, PSClass.Layer, desc2);
    executeAction(sTID('set'), desc1, dialogMode);
  };

  // Çàäàòü
  function step31(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var desc1 = new ActionDescriptor();
    var ref1 = new ActionReference();
    ref1.putEnumerated(PSClass.Layer, PSType.Ordinal, PSEnum.Target);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    desc2.putUnitDouble(PSKey.Opacity, PSUnit.Percent, 15);
    desc1.putObject(PSKey.To, PSClass.Layer, desc2);
    executeAction(sTID('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.putEnumerated(PSClass.Layer, PSType.Ordinal, PSEnum.Target);
    desc1.putReference(PSString.Null, ref1);
    var ref2 = new ActionReference();
    ref2.putEnumerated(PSClass.Layer, PSType.Ordinal, PSEnum.Previous);
    desc1.putReference(PSKey.To, ref2);
    executeAction(sTID('move'), 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.Forward);
    desc1.putReference(PSString.Null, ref1);
    desc1.putBoolean(PSKey.MakeVisible, false);
    executeAction(sTID('select'), 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.Backward);
    desc1.putReference(PSString.Null, ref1);
    desc1.putEnumerated(PSString.selectionModifier, PSString.selectionModifierType, PSString.addToSelection);
    desc1.putBoolean(PSKey.MakeVisible, false);
    executeAction(sTID('select'), 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.putEnumerated(PSClass.Layer, PSType.Ordinal, PSEnum.Backward);
    desc1.putReference(PSString.Null, ref1);
    desc1.putEnumerated(PSString.selectionModifier, PSString.selectionModifierType, PSString.addToSelection);
    desc1.putBoolean(PSKey.MakeVisible, false);
    executeAction(sTID('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.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);
    var desc2 = new ActionDescriptor();
    desc2.putString(PSKey.Name, "J2");
    desc1.putObject(PSKey.Using, PSString.layerGroup, desc2);
    executeAction(sTID('make'), desc1, dialogMode);
  };

  step1();      // Ñäåëàòü
  step2();      // Ïåðåìåùåíèå
  step3();      // Çàäàòü
  step4();      // Ñäåëàòü
  step5();      // Çàäàòü
  step6();      // Ñäåëàòü
  step7();      // Çàäàòü
  step8();      // Âíåøíèé êàíàë
  step9();      // Âûäåëåíèå
  step10();      // Âûäåëåíèå
  step11();      // Ñäåëàòü
  step12();      // Çàäàòü
  step13();      // Çàäàòü
  step14();      // Ñîçäàòü äóáëèêàò
  step15();      // Óäàëèòü
  step16();      // Çàäàòü
  step17();      // Âûäåëåíèå
  step18();      // Çàäàòü
  step19();      // Ñäåëàòü
  step20();      // Çàäàòü
  step21();      // Çàäàòü
  step22();      // Óäàëèòü
  step23();      // Çàäàòü
  step24();      // Çàäàòü
  step25();      // Ñäåëàòü
  step26();      // Çàäàòü
  step27();      // Çàäàòü
  step28();      // Ïåðåìåùåíèå
  step29();      // Ñäåëàòü
  step30();      // Çàäàòü
  step31();      // Çàäàòü
  step32();      // Ïåðåìåùåíèå
  step33();      // Âûäåëåíèå
  step34();      // Âûäåëåíèå
  step35();      // Âûäåëåíèå
  step36();      // Ñäåëàòü
};



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

//
// J2.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.
//
J2.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.ColorCorrection = cTID('ClrC');
  PSClass.ColorStop = cTID('Clrt');
  PSClass.Curves = cTID('Crvs');
  PSClass.CurvesAdjustment = cTID('CrvA');
  PSClass.Gradient = cTID('Grdn');
  PSClass.GradientMap = cTID('GdMp');
  PSClass.Layer = cTID('Lyr ');
  PSClass.Point = cTID('Pnt ');
  PSClass.RGBColor = cTID('RGBC');
  PSClass.SelectiveColor = cTID('SlcC');
  PSClass.TransparencyStop = cTID('TrnS');
  PSEnum.Absolute = cTID('Absl');
  PSEnum.Backward = cTID('Bckw');
  PSEnum.Blocks = cTID('Blks');
  PSEnum.Blues = cTID('Bls ');
  PSEnum.Composite = cTID('Cmps');
  PSEnum.CustomStops = cTID('CstS');
  PSEnum.Cyans = cTID('Cyns');
  PSEnum.Exclusion = cTID('Xclu');
  PSEnum.Forward = cTID('Frwr');
  PSEnum.Front = cTID('Frnt');
  PSEnum.Greens = cTID('Grns');
  PSEnum.Magentas = cTID('Mgnt');
  PSEnum.Merged = cTID('Mrgd');
  PSEnum.Multiply = cTID('Mltp');
  PSEnum.Neutrals = cTID('Ntrl');
  PSEnum.None = cTID('None');
  PSEnum.Previous = cTID('Prvs');
  PSEnum.RGB = cTID('RGB ');
  PSEnum.Reds = cTID('Rds ');
  PSEnum.Target = cTID('Trgt');
  PSEnum.UserStop = cTID('UsrS');
  PSEnum.Whites = cTID('Whts');
  PSEnum.Yellows = cTID('Ylws');
  PSKey.Adjustment = cTID('Adjs');
  PSKey.Black = cTID('Blck');
  PSKey.Blue = cTID('Bl  ');
  PSKey.Calculation = cTID('Clcl');
  PSKey.Color = cTID('Clr ');
  PSKey.Colors = cTID('Clrs');
  PSKey.Curve = cTID('Crv ');
  PSKey.From = cTID('From');
  PSKey.Gradient = cTID('Grad');
  PSKey.Green = cTID('Grn ');
  PSKey.Horizontal = cTID('Hrzn');
  PSKey.Interpolation = cTID('Intr');
  PSKey.Location = cTID('Lctn');
  PSKey.MakeVisible = cTID('MkVs');
  PSKey.Method = cTID('Mthd');
  PSKey.Midpoint = cTID('Mdpn');
  PSKey.Mode = cTID('Md  ');
  PSKey.Name = cTID('Nm  ');
  PSKey.Opacity = cTID('Opct');
  PSKey.Red = cTID('Rd  ');
  PSKey.Start = cTID('Strt');
  PSKey.To = cTID('T   ');
  PSKey.Transparency = cTID('Trns');
  PSKey.Type = cTID('Type');
  PSKey.Using = cTID('Usng');
  PSKey.Vertical = cTID('Vrtc');
  PSKey.With = cTID('With');
  PSString.Null = sTID('null');
  PSString.addToSelection = sTID('addToSelection');
  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.Calculation = cTID('Clcn');
  PSType.ColorStopType = cTID('Clry');
  PSType.CorrectionMethod = cTID('CrcM');
  PSType.GradientForm = cTID('GrdF');
  PSType.Ordinal = cTID('Ordn');
  PSUnit.Percent = cTID('#Prc');
};

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



//=========================================
//                    J2.main
//=========================================
//

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

J2.main();

// EOF

    },
};

$._ext_J3={
    run : function() {
//
// Generated Thu Aug 20 2015 16:28:44 GMT+0400
//

//
//==================== J3 ==============
//
function J3() {
  // Ñäåëàòü
  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.AdjustmentLayer);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    desc2.putString(PSKey.Name, "SelectiveColor");
    var desc3 = new ActionDescriptor();
    desc3.putEnumerated(PSString.presetKind, PSString.presetKindType, PSString.presetKindDefault);
    desc2.putObject(PSKey.Type, PSClass.SelectiveColor, desc3);
    desc1.putObject(PSKey.Using, PSClass.AdjustmentLayer, desc2);
    executeAction(sTID('make'), desc1, dialogMode);
  };

  // Ïåðåìåùåíèå
  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 ref2 = new ActionReference();
    ref2.putEnumerated(PSClass.Layer, PSType.Ordinal, PSEnum.Front);
    desc1.putReference(PSKey.To, ref2);
    executeAction(sTID('move'), 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.AdjustmentLayer, PSType.Ordinal, PSEnum.Target);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    desc2.putEnumerated(PSString.presetKind, PSString.presetKindType, PSString.presetKindCustom);
    desc2.putEnumerated(PSKey.Method, PSType.CorrectionMethod, PSEnum.Absolute);
    var list1 = new ActionList();
    var desc3 = new ActionDescriptor();
    desc3.putEnumerated(PSKey.Colors, PSKey.Colors, PSEnum.Reds);
    desc3.putUnitDouble(PSKey.Black, PSUnit.Percent, -100);
    list1.putObject(PSClass.ColorCorrection, desc3);
    var desc4 = new ActionDescriptor();
    desc4.putEnumerated(PSKey.Colors, PSKey.Colors, PSEnum.Yellows);
    desc4.putUnitDouble(PSKey.Black, PSUnit.Percent, -100);
    list1.putObject(PSClass.ColorCorrection, desc4);
    var desc5 = new ActionDescriptor();
    desc5.putEnumerated(PSKey.Colors, PSKey.Colors, PSEnum.Greens);
    desc5.putUnitDouble(PSKey.Black, PSUnit.Percent, -100);
    list1.putObject(PSClass.ColorCorrection, desc5);
    var desc6 = new ActionDescriptor();
    desc6.putEnumerated(PSKey.Colors, PSKey.Colors, PSEnum.Cyans);
    desc6.putUnitDouble(PSKey.Black, PSUnit.Percent, -100);
    list1.putObject(PSClass.ColorCorrection, desc6);
    var desc7 = new ActionDescriptor();
    desc7.putEnumerated(PSKey.Colors, PSKey.Colors, PSEnum.Blues);
    desc7.putUnitDouble(PSKey.Black, PSUnit.Percent, -100);
    list1.putObject(PSClass.ColorCorrection, desc7);
    var desc8 = new ActionDescriptor();
    desc8.putEnumerated(PSKey.Colors, PSKey.Colors, PSEnum.Magentas);
    desc8.putUnitDouble(PSKey.Black, PSUnit.Percent, -100);
    list1.putObject(PSClass.ColorCorrection, desc8);
    var desc9 = new ActionDescriptor();
    desc9.putEnumerated(PSKey.Colors, PSKey.Colors, PSEnum.Whites);
    desc9.putUnitDouble(PSKey.Black, PSUnit.Percent, 100);
    list1.putObject(PSClass.ColorCorrection, desc9);
    var desc10 = new ActionDescriptor();
    desc10.putEnumerated(PSKey.Colors, PSKey.Colors, PSEnum.Neutrals);
    desc10.putUnitDouble(PSKey.Black, PSUnit.Percent, 100);
    list1.putObject(PSClass.ColorCorrection, desc10);
    var desc11 = new ActionDescriptor();
    desc11.putEnumerated(PSKey.Colors, PSKey.Colors, PSEnum.Blocks);
    desc11.putUnitDouble(PSKey.Black, PSUnit.Percent, 100);
    list1.putObject(PSClass.ColorCorrection, desc11);
    desc2.putList(PSClass.ColorCorrection, list1);
    desc1.putObject(PSKey.To, PSClass.SelectiveColor, desc2);
    executeAction(sTID('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.putClass(PSClass.AdjustmentLayer);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    desc2.putString(PSKey.Name, "ContrastForMask");
    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(sTID('make'), desc1, 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.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, 0);
    desc4.putDouble(PSKey.Vertical, 0);
    list2.putObject(PSClass.Point, desc4);
    var desc5 = new ActionDescriptor();
    desc5.putDouble(PSKey.Horizontal, 128);
    desc5.putDouble(PSKey.Vertical, 255);
    list2.putObject(PSClass.Point, desc5);
    desc3.putList(PSKey.Curve, list2);
    list1.putObject(PSClass.CurvesAdjustment, desc3);
    desc2.putList(PSKey.Adjustment, list1);
    desc1.putObject(PSKey.To, PSClass.Curves, desc2);
    executeAction(sTID('set'), 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(sTID('make'), 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.putEnumerated(PSClass.Layer, PSType.Ordinal, PSEnum.Target);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    desc2.putString(PSKey.Name, "Merged");
    desc1.putObject(PSKey.To, PSClass.Layer, desc2);
    executeAction(sTID('set'), desc1, dialogMode);
  };

  // Âíåøíèé êàíàë
  function step8(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);
    desc2.putEnumerated(PSKey.Calculation, PSType.Calculation, PSEnum.Multiply);
    desc1.putObject(PSKey.With, PSKey.Calculation, desc2);
    executeAction(sTID('applyImageEvent'), desc1, dialogMode);
  };

  // Âûäåëåíèå
  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.Backward);
    desc1.putReference(PSString.Null, ref1);
    desc1.putEnumerated(PSString.selectionModifier, PSString.selectionModifierType, PSString.addToSelection);
    desc1.putBoolean(PSKey.MakeVisible, false);
    executeAction(sTID('select'), 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.Backward);
    desc1.putReference(PSString.Null, ref1);
    desc1.putEnumerated(PSString.selectionModifier, PSString.selectionModifierType, PSString.addToSelection);
    desc1.putBoolean(PSKey.MakeVisible, false);
    executeAction(sTID('select'), desc1, dialogMode);
  };

  // Ñäåëàòü
  function step11(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var desc1 = new ActionDescriptor();
    var ref1 = new ActionReference();
    ref1.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(sTID('make'), desc1, dialogMode);
  };

  // Çàäàòü
  function step12(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var desc1 = new ActionDescriptor();
    var ref1 = new ActionReference();
    ref1.putEnumerated(PSClass.Layer, PSType.Ordinal, PSEnum.Target);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    desc2.putString(PSKey.Name, "Saturation Mask");
    desc1.putObject(PSKey.To, PSClass.Layer, desc2);
    executeAction(sTID('set'), 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.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSString.Null, ref1);
    var ref2 = new ActionReference();
    ref2.putEnumerated(PSClass.Channel, PSClass.Channel, PSEnum.RGB);
    desc1.putReference(PSKey.To, ref2);
    executeAction(sTID('set'), 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.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSString.Null, ref1);
    desc1.putString(PSKey.Name, "SaturnMask");
    executeAction(sTID('duplicate'), 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.putEnumerated(PSClass.Layer, PSType.Ordinal, PSEnum.Target);
    desc1.putReference(PSString.Null, ref1);
    executeAction(sTID('delete'), 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);
    desc1.putEnumerated(PSKey.To, PSType.Ordinal, PSEnum.None);
    executeAction(sTID('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.Channel, PSClass.Channel, PSEnum.RGB);
    desc1.putReference(PSString.Null, ref1);
    executeAction(sTID('select'), 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.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSString.Null, ref1);
    var ref2 = new ActionReference();
    ref2.putName(PSClass.Channel, "SaturnMask");
    desc1.putReference(PSKey.To, ref2);
    executeAction(sTID('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();
    desc2.putString(PSKey.Name, "Desaturate heavily saturated");
    desc2.putClass(PSKey.Type, sTID("vibrance"));
    desc1.putObject(PSKey.Using, PSClass.AdjustmentLayer, desc2);
    executeAction(sTID('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.Layer, PSType.Ordinal, PSEnum.Target);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    desc2.putUnitDouble(PSKey.Opacity, PSUnit.Percent, 50);
    desc1.putObject(PSKey.To, PSClass.Layer, desc2);
    executeAction(sTID('set'), 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.AdjustmentLayer, PSType.Ordinal, PSEnum.Target);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    desc2.putInteger(PSKey.Start, -50);
    desc1.putObject(PSKey.To, sTID("vibrance"), desc2);
    executeAction(sTID('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.putName(PSClass.Channel, "SaturnMask");
    desc1.putReference(PSString.Null, ref1);
    executeAction(sTID('delete'), 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.Layer, PSType.Ordinal, PSEnum.Target);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    desc2.putString(PSKey.Name, "Desaturate heavily saturated C3");
    desc1.putObject(PSKey.To, PSClass.Layer, desc2);
    executeAction(sTID('set'), 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.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSString.Null, ref1);
    var ref2 = new ActionReference();
    ref2.putEnumerated(PSClass.Channel, PSClass.Channel, PSEnum.RGB);
    desc1.putReference(PSKey.To, ref2);
    executeAction(sTID('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.putClass(PSClass.AdjustmentLayer);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    desc2.putString(PSKey.Name, "C3 Lights");
    var desc3 = new ActionDescriptor();
    var list1 = new ActionList();
    list1.putInteger(0);
    list1.putInteger(sTID("skinTone"), 0);
    list1.putInteger(sTID("contentAware"), 0);
    desc3.putList(PSKey.ShadowLevels, list1);
    var list2 = new ActionList();
    list2.putInteger(0);
    list2.putInteger(sTID("skinTone"), 0);
    list2.putInteger(sTID("contentAware"), 0);
    desc3.putList(PSKey.MidtoneLevels, list2);
    var list3 = new ActionList();
    list3.putInteger(0);
    list3.putInteger(sTID("skinTone"), 0);
    list3.putInteger(sTID("contentAware"), 0);
    desc3.putList(PSKey.HighlightLevels, list3);
    desc3.putBoolean(PSKey.PreserveLuminosity, true);
    desc2.putObject(PSKey.Type, PSClass.ColorBalance, desc3);
    desc1.putObject(PSKey.Using, PSClass.AdjustmentLayer, desc2);
    executeAction(sTID('make'), desc1, dialogMode);
  };

  // Çàäàòü
  function step26(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var desc1 = new ActionDescriptor();
    var ref1 = new ActionReference();
    ref1.putEnumerated(PSClass.AdjustmentLayer, PSType.Ordinal, PSEnum.Target);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    var list1 = new ActionList();
    list1.putInteger(15);
    list1.putInteger(sTID("skinTone"), 0);
    list1.putInteger(sTID("contentAware"), -30);
    desc2.putList(PSKey.MidtoneLevels, list1);
    var list2 = new ActionList();
    list2.putInteger(10);
    list2.putInteger(sTID("skinTone"), 0);
    list2.putInteger(sTID("contentAware"), -25);
    desc2.putList(PSKey.HighlightLevels, list2);
    desc1.putObject(PSKey.To, PSClass.ColorBalance, desc2);
    executeAction(sTID('set'), 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.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSString.Null, ref1);
    desc1.putEnumerated(PSKey.To, PSType.Ordinal, PSEnum.All);
    executeAction(sTID('set'), 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.Channel, PSClass.Channel, PSEnum.RGB);
    desc1.putReference(PSString.Null, ref1);
    var ref2 = new ActionReference();
    ref2.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSKey.From, ref2);
    executeAction(sTID('subtract'), desc1, dialogMode);
  };

  // Ñäåëàòü
  function step29(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var desc1 = new ActionDescriptor();
    var ref1 = new ActionReference();
    ref1.putClass(PSClass.AdjustmentLayer);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    desc2.putString(PSKey.Name, "C3 Shadows");
    var desc3 = new ActionDescriptor();
    var list1 = new ActionList();
    list1.putInteger(0);
    list1.putInteger(sTID("skinTone"), 0);
    list1.putInteger(sTID("contentAware"), 0);
    desc3.putList(PSKey.ShadowLevels, list1);
    var list2 = new ActionList();
    list2.putInteger(0);
    list2.putInteger(sTID("skinTone"), 0);
    list2.putInteger(sTID("contentAware"), 0);
    desc3.putList(PSKey.MidtoneLevels, list2);
    var list3 = new ActionList();
    list3.putInteger(0);
    list3.putInteger(sTID("skinTone"), 0);
    list3.putInteger(sTID("contentAware"), 0);
    desc3.putList(PSKey.HighlightLevels, list3);
    desc3.putBoolean(PSKey.PreserveLuminosity, true);
    desc2.putObject(PSKey.Type, PSClass.ColorBalance, desc3);
    desc1.putObject(PSKey.Using, PSClass.AdjustmentLayer, desc2);
    executeAction(sTID('make'), desc1, dialogMode);
  };

  // Çàäàòü
  function step30(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var desc1 = new ActionDescriptor();
    var ref1 = new ActionReference();
    ref1.putEnumerated(PSClass.AdjustmentLayer, PSType.Ordinal, PSEnum.Target);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    var list1 = new ActionList();
    list1.putInteger(-10);
    list1.putInteger(sTID("skinTone"), 7);
    list1.putInteger(sTID("contentAware"), 15);
    desc2.putList(PSKey.ShadowLevels, list1);
    var list2 = new ActionList();
    list2.putInteger(15);
    list2.putInteger(sTID("skinTone"), 10);
    list2.putInteger(sTID("contentAware"), 30);
    desc2.putList(PSKey.MidtoneLevels, list2);
    desc1.putObject(PSKey.To, PSClass.ColorBalance, desc2);
    executeAction(sTID('set'), desc1, dialogMode);
  };

  // Ïåðåìåùåíèå
  function step31(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var desc1 = new ActionDescriptor();
    var ref1 = new ActionReference();
    ref1.putEnumerated(PSClass.Layer, PSType.Ordinal, PSEnum.Target);
    desc1.putReference(PSString.Null, ref1);
    var ref2 = new ActionReference();
    ref2.putEnumerated(PSClass.Layer, PSType.Ordinal, PSEnum.Previous);
    desc1.putReference(PSKey.To, ref2);
    executeAction(sTID('move'), 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.putClass(PSString.contentLayer);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    desc2.putString(PSKey.Name, "Desaturation C3");
    var desc3 = new ActionDescriptor();
    var desc4 = new ActionDescriptor();
    desc4.putDouble(PSKey.Red, 127.501945495605);
    desc4.putDouble(PSKey.Green, 127.501945495605);
    desc4.putDouble(PSKey.Blue, 127.501945495605);
    desc3.putObject(PSKey.Color, PSClass.RGBColor, desc4);
    desc2.putObject(PSKey.Type, PSString.solidColorLayer, desc3);
    desc1.putObject(PSKey.Using, PSString.contentLayer, desc2);
    executeAction(sTID('make'), 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.putEnumerated(PSKey.Mode, PSType.BlendMode, PSKey.Color);
    desc1.putObject(PSKey.To, PSClass.Layer, desc2);
    executeAction(sTID('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.putUnitDouble(PSKey.Opacity, PSUnit.Percent, 15);
    desc1.putObject(PSKey.To, PSClass.Layer, desc2);
    executeAction(sTID('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.putEnumerated(PSClass.Layer, PSType.Ordinal, PSEnum.Target);
    desc1.putReference(PSString.Null, ref1);
    var ref2 = new ActionReference();
    ref2.putEnumerated(PSClass.Layer, PSType.Ordinal, PSEnum.Previous);
    desc1.putReference(PSKey.To, ref2);
    executeAction(sTID('move'), 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.Forward);
    desc1.putReference(PSString.Null, ref1);
    desc1.putBoolean(PSKey.MakeVisible, false);
    executeAction(sTID('select'), 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.Forward);
    desc1.putReference(PSString.Null, ref1);
    desc1.putBoolean(PSKey.MakeVisible, false);
    executeAction(sTID('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.Backward);
    desc1.putReference(PSString.Null, ref1);
    desc1.putEnumerated(PSString.selectionModifier, PSString.selectionModifierType, PSString.addToSelection);
    desc1.putBoolean(PSKey.MakeVisible, false);
    executeAction(sTID('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.Backward);
    desc1.putReference(PSString.Null, ref1);
    desc1.putEnumerated(PSString.selectionModifier, PSString.selectionModifierType, PSString.addToSelection);
    desc1.putBoolean(PSKey.MakeVisible, false);
    executeAction(sTID('select'), 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.Backward);
    desc1.putReference(PSString.Null, ref1);
    desc1.putEnumerated(PSString.selectionModifier, PSString.selectionModifierType, PSString.addToSelection);
    desc1.putBoolean(PSKey.MakeVisible, false);
    executeAction(sTID('select'), desc1, dialogMode);
  };

  // Ñäåëàòü
  function step41(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var desc1 = new ActionDescriptor();
    var ref1 = new ActionReference();
    ref1.putClass(PSString.layerGroup);
    desc1.putReference(PSString.Null, ref1);
    var ref2 = new ActionReference();
    ref2.putEnumerated(PSClass.Layer, PSType.Ordinal, PSEnum.Target);
    desc1.putReference(PSKey.From, ref2);
    var desc2 = new ActionDescriptor();
    desc2.putString(PSKey.Name, "J3");
    desc1.putObject(PSKey.Using, PSString.layerGroup, desc2);
    executeAction(sTID('make'), desc1, dialogMode);
  };

  step1();      // Ñäåëàòü
  step2();      // Ïåðåìåùåíèå
  step3();      // Çàäàòü
  step4();      // Ñäåëàòü
  step5();      // Çàäàòü
  step6();      // Ñäåëàòü
  step7();      // Çàäàòü
  step8();      // Âíåøíèé êàíàë
  step9();      // Âûäåëåíèå
  step10();      // Âûäåëåíèå
  step11();      // Ñäåëàòü
  step12();      // Çàäàòü
  step13();      // Çàäàòü
  step14();      // Ñîçäàòü äóáëèêàò
  step15();      // Óäàëèòü
  step16();      // Çàäàòü
  step17();      // Âûäåëåíèå
  step18();      // Çàäàòü
  step19();      // Ñäåëàòü
  step20();      // Çàäàòü
  step21();      // Çàäàòü
  step22();      // Óäàëèòü
  step23();      // Çàäàòü
  step24();      // Çàäàòü
  step25();      // Ñäåëàòü
  step26();      // Çàäàòü
  step27();      // Çàäàòü
  step28();      // Âû÷èòàíèå
  step29();      // Ñäåëàòü
  step30();      // Çàäàòü
  step31();      // Ïåðåìåùåíèå
  step32();      // Ñäåëàòü
  step33();      // Çàäàòü
  step34();      // Çàäàòü
  step35();      // Ïåðåìåùåíèå
  step36();      // Âûäåëåíèå
  step37();      // Âûäåëåíèå
  step38();      // Âûäåëåíèå
  step39();      // Âûäåëåíèå
  step40();      // Âûäåëåíèå
  step41();      // Ñäåëàòü
};



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

//
// J3.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.
//
J3.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.ColorBalance = cTID('ClrB');
  PSClass.ColorCorrection = cTID('ClrC');
  PSClass.ColorStop = cTID('Clrt');
  PSClass.Curves = cTID('Crvs');
  PSClass.CurvesAdjustment = cTID('CrvA');
  PSClass.Gradient = cTID('Grdn');
  PSClass.GradientMap = cTID('GdMp');
  PSClass.Layer = cTID('Lyr ');
  PSClass.Point = cTID('Pnt ');
  PSClass.RGBColor = cTID('RGBC');
  PSClass.SelectiveColor = cTID('SlcC');
  PSClass.TransparencyStop = cTID('TrnS');
  PSEnum.Absolute = cTID('Absl');
  PSEnum.All = cTID('Al  ');
  PSEnum.Backward = cTID('Bckw');
  PSEnum.Blocks = cTID('Blks');
  PSEnum.Blues = cTID('Bls ');
  PSEnum.Composite = cTID('Cmps');
  PSEnum.CustomStops = cTID('CstS');
  PSEnum.Cyans = cTID('Cyns');
  PSEnum.Exclusion = cTID('Xclu');
  PSEnum.Forward = cTID('Frwr');
  PSEnum.Front = cTID('Frnt');
  PSEnum.Greens = cTID('Grns');
  PSEnum.Magentas = cTID('Mgnt');
  PSEnum.Merged = cTID('Mrgd');
  PSEnum.Multiply = cTID('Mltp');
  PSEnum.Neutrals = cTID('Ntrl');
  PSEnum.None = cTID('None');
  PSEnum.Previous = cTID('Prvs');
  PSEnum.RGB = cTID('RGB ');
  PSEnum.Reds = cTID('Rds ');
  PSEnum.Target = cTID('Trgt');
  PSEnum.UserStop = cTID('UsrS');
  PSEnum.Whites = cTID('Whts');
  PSEnum.Yellows = cTID('Ylws');
  PSKey.Adjustment = cTID('Adjs');
  PSKey.Black = cTID('Blck');
  PSKey.Blue = cTID('Bl  ');
  PSKey.Calculation = cTID('Clcl');
  PSKey.Color = cTID('Clr ');
  PSKey.Colors = cTID('Clrs');
  PSKey.Curve = cTID('Crv ');
  PSKey.From = cTID('From');
  PSKey.Gradient = cTID('Grad');
  PSKey.Green = cTID('Grn ');
  PSKey.HighlightLevels = cTID('HghL');
  PSKey.Horizontal = cTID('Hrzn');
  PSKey.Interpolation = cTID('Intr');
  PSKey.Location = cTID('Lctn');
  PSKey.MakeVisible = cTID('MkVs');
  PSKey.Method = cTID('Mthd');
  PSKey.Midpoint = cTID('Mdpn');
  PSKey.MidtoneLevels = cTID('MdtL');
  PSKey.Mode = cTID('Md  ');
  PSKey.Name = cTID('Nm  ');
  PSKey.Opacity = cTID('Opct');
  PSKey.PreserveLuminosity = cTID('PrsL');
  PSKey.Red = cTID('Rd  ');
  PSKey.ShadowLevels = cTID('ShdL');
  PSKey.Start = cTID('Strt');
  PSKey.To = cTID('T   ');
  PSKey.Transparency = cTID('Trns');
  PSKey.Type = cTID('Type');
  PSKey.Using = cTID('Usng');
  PSKey.Vertical = cTID('Vrtc');
  PSKey.With = cTID('With');
  PSString.Null = sTID('null');
  PSString.addToSelection = sTID('addToSelection');
  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.Calculation = cTID('Clcn');
  PSType.ColorStopType = cTID('Clry');
  PSType.CorrectionMethod = cTID('CrcM');
  PSType.GradientForm = cTID('GrdF');
  PSType.Ordinal = cTID('Ordn');
  PSUnit.Percent = cTID('#Prc');
};

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



//=========================================
//                    J3.main
//=========================================
//

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

J3.main();

// EOF

    },
};

$._ext_S1={
    run : function() {
//
// Generated Thu Aug 20 2015 16:05:15 GMT+0400
//

//
//==================== S1 ==============
//
function S1() {
  // 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.AdjustmentLayer);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    desc2.putString(PSKey.Name, "SelectiveColor");
    var desc3 = new ActionDescriptor();
    desc3.putEnumerated(PSString.presetKind, PSString.presetKindType, PSString.presetKindDefault);
    desc2.putObject(PSKey.Type, PSClass.SelectiveColor, desc3);
    desc1.putObject(PSKey.Using, PSClass.AdjustmentLayer, desc2);
    executeAction(PSEvent.Make, desc1, dialogMode);
  };

  // Move
  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 ref2 = new ActionReference();
    ref2.putEnumerated(PSClass.Layer, PSType.Ordinal, PSEnum.Front);
    desc1.putReference(PSKey.To, ref2);
    executeAction(PSEvent.Move, 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.AdjustmentLayer, PSType.Ordinal, PSEnum.Target);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    desc2.putEnumerated(PSString.presetKind, PSString.presetKindType, PSString.presetKindCustom);
    desc2.putEnumerated(PSKey.Method, PSType.CorrectionMethod, PSEnum.Absolute);
    var list1 = new ActionList();
    var desc3 = new ActionDescriptor();
    desc3.putEnumerated(PSKey.Colors, PSKey.Colors, PSEnum.Reds);
    desc3.putUnitDouble(PSKey.Black, PSUnit.Percent, -100);
    list1.putObject(PSClass.ColorCorrection, desc3);
    var desc4 = new ActionDescriptor();
    desc4.putEnumerated(PSKey.Colors, PSKey.Colors, PSEnum.Yellows);
    desc4.putUnitDouble(PSKey.Black, PSUnit.Percent, -100);
    list1.putObject(PSClass.ColorCorrection, desc4);
    var desc5 = new ActionDescriptor();
    desc5.putEnumerated(PSKey.Colors, PSKey.Colors, PSEnum.Greens);
    desc5.putUnitDouble(PSKey.Black, PSUnit.Percent, -100);
    list1.putObject(PSClass.ColorCorrection, desc5);
    var desc6 = new ActionDescriptor();
    desc6.putEnumerated(PSKey.Colors, PSKey.Colors, PSEnum.Cyans);
    desc6.putUnitDouble(PSKey.Black, PSUnit.Percent, -100);
    list1.putObject(PSClass.ColorCorrection, desc6);
    var desc7 = new ActionDescriptor();
    desc7.putEnumerated(PSKey.Colors, PSKey.Colors, PSEnum.Blues);
    desc7.putUnitDouble(PSKey.Black, PSUnit.Percent, -100);
    list1.putObject(PSClass.ColorCorrection, desc7);
    var desc8 = new ActionDescriptor();
    desc8.putEnumerated(PSKey.Colors, PSKey.Colors, PSEnum.Magentas);
    desc8.putUnitDouble(PSKey.Black, PSUnit.Percent, -100);
    list1.putObject(PSClass.ColorCorrection, desc8);
    var desc9 = new ActionDescriptor();
    desc9.putEnumerated(PSKey.Colors, PSKey.Colors, PSEnum.Whites);
    desc9.putUnitDouble(PSKey.Black, PSUnit.Percent, 100);
    list1.putObject(PSClass.ColorCorrection, desc9);
    var desc10 = new ActionDescriptor();
    desc10.putEnumerated(PSKey.Colors, PSKey.Colors, PSEnum.Neutrals);
    desc10.putUnitDouble(PSKey.Black, PSUnit.Percent, 100);
    list1.putObject(PSClass.ColorCorrection, desc10);
    var desc11 = new ActionDescriptor();
    desc11.putEnumerated(PSKey.Colors, PSKey.Colors, PSEnum.Blocks);
    desc11.putUnitDouble(PSKey.Black, PSUnit.Percent, 100);
    list1.putObject(PSClass.ColorCorrection, desc11);
    desc2.putList(PSClass.ColorCorrection, list1);
    desc1.putObject(PSKey.To, PSClass.SelectiveColor, 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.AdjustmentLayer);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    desc2.putString(PSKey.Name, "ContrastForMask");
    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);
  };

  // Set
  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.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, 0);
    desc4.putDouble(PSKey.Vertical, 0);
    list2.putObject(PSClass.Point, desc4);
    var desc5 = new ActionDescriptor();
    desc5.putDouble(PSKey.Horizontal, 128);
    desc5.putDouble(PSKey.Vertical, 255);
    list2.putObject(PSClass.Point, desc5);
    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);
  };

  // Make
  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);
  };

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

  // Apply Image
  function step8(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);
    desc2.putEnumerated(PSKey.Calculation, PSType.Calculation, PSEnum.Multiply);
    desc1.putObject(PSKey.With, PSKey.Calculation, desc2);
    executeAction(sTID('applyImageEvent'), desc1, dialogMode);
  };

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

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

  // Make
  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.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);
  };

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

  // Set
  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.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSString.Null, ref1);
    var ref2 = new ActionReference();
    ref2.putEnumerated(PSClass.Channel, PSClass.Channel, PSEnum.RGB);
    desc1.putReference(PSKey.To, ref2);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

  // Duplicate
  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.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSString.Null, ref1);
    desc1.putString(PSKey.Name, "SaturnMask");
    executeAction(PSEvent.Duplicate, desc1, dialogMode);
  };

  // Delete
  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.Layer, PSType.Ordinal, PSEnum.Target);
    desc1.putReference(PSString.Null, ref1);
    executeAction(PSEvent.Delete, 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.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSString.Null, ref1);
    desc1.putEnumerated(PSKey.To, PSType.Ordinal, PSEnum.None);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

  // Select
  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.Channel, PSClass.Channel, PSEnum.RGB);
    desc1.putReference(PSString.Null, ref1);
    executeAction(PSEvent.Select, 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.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSString.Null, ref1);
    var ref2 = new ActionReference();
    ref2.putName(PSClass.Channel, "SaturnMask");
    desc1.putReference(PSKey.To, ref2);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

  // Make
  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();
    desc2.putString(PSKey.Name, "Desaturate heavily saturated");
    desc2.putClass(PSKey.Type, sTID("vibrance"));
    desc1.putObject(PSKey.Using, PSClass.AdjustmentLayer, desc2);
    executeAction(PSEvent.Make, desc1, dialogMode);
  };

  // Set
  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.Layer, PSType.Ordinal, PSEnum.Target);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    desc2.putUnitDouble(PSKey.Opacity, PSUnit.Percent, 50);
    desc1.putObject(PSKey.To, PSClass.Layer, desc2);
    executeAction(PSEvent.Set, 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.AdjustmentLayer, PSType.Ordinal, PSEnum.Target);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    desc2.putInteger(PSKey.Start, -50);
    desc1.putObject(PSKey.To, sTID("vibrance"), desc2);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

  // Delete
  function step22(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var desc1 = new ActionDescriptor();
    var ref1 = new ActionReference();
    ref1.putName(PSClass.Channel, "SaturnMask");
    desc1.putReference(PSString.Null, ref1);
    executeAction(PSEvent.Delete, desc1, dialogMode);
  };

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

  // Make
  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.putClass(PSString.contentLayer);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    var desc3 = new ActionDescriptor();
    var desc4 = new ActionDescriptor();
    desc4.putDouble(PSKey.Red, 51.0031127929688);
    desc4.putDouble(PSKey.Green, 25.9996032714844);
    desc4.putDouble(PSKey.Blue, 11.9998168945313);
    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 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.putEnumerated(PSKey.Mode, PSType.BlendMode, PSEnum.Exclusion);
    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, 20);
    desc1.putObject(PSKey.To, PSClass.Layer, desc2);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

  // Move
  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 ref2 = new ActionReference();
    ref2.putEnumerated(PSClass.Layer, PSType.Ordinal, PSEnum.Front);
    desc1.putReference(PSKey.To, ref2);
    executeAction(PSEvent.Move, desc1, dialogMode);
  };

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

  // Make
  function step29(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var desc1 = new ActionDescriptor();
    var ref1 = new ActionReference();
    ref1.putClass(PSString.contentLayer);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    desc2.putString(PSKey.Name, "Desaturation A1");
    var desc3 = new ActionDescriptor();
    var desc4 = new ActionDescriptor();
    desc4.putDouble(PSKey.Red, 127.501945495605);
    desc4.putDouble(PSKey.Green, 127.501945495605);
    desc4.putDouble(PSKey.Blue, 127.501945495605);
    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 step30(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var desc1 = new ActionDescriptor();
    var ref1 = new ActionReference();
    ref1.putEnumerated(PSClass.Layer, PSType.Ordinal, PSEnum.Target);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    desc2.putEnumerated(PSKey.Mode, PSType.BlendMode, PSKey.Color);
    desc1.putObject(PSKey.To, PSClass.Layer, desc2);
    executeAction(PSEvent.Set, 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.Layer, PSType.Ordinal, PSEnum.Target);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    desc2.putUnitDouble(PSKey.Opacity, PSUnit.Percent, 15);
    desc1.putObject(PSKey.To, PSClass.Layer, desc2);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

  // Move
  function step32(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var desc1 = new ActionDescriptor();
    var ref1 = new ActionReference();
    ref1.putEnumerated(PSClass.Layer, PSType.Ordinal, PSEnum.Target);
    desc1.putReference(PSString.Null, ref1);
    var ref2 = new ActionReference();
    ref2.putEnumerated(PSClass.Layer, PSType.Ordinal, PSEnum.Previous);
    desc1.putReference(PSKey.To, ref2);
    executeAction(PSEvent.Move, desc1, dialogMode);
  };

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

  // Select
  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.Backward);
    desc1.putReference(PSString.Null, ref1);
    desc1.putEnumerated(PSString.selectionModifier, PSString.selectionModifierType, PSString.addToSelection);
    desc1.putBoolean(PSKey.MakeVisible, false);
    executeAction(PSEvent.Select, 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.Layer, PSType.Ordinal, PSEnum.Backward);
    desc1.putReference(PSString.Null, ref1);
    desc1.putEnumerated(PSString.selectionModifier, PSString.selectionModifierType, PSString.addToSelection);
    desc1.putBoolean(PSKey.MakeVisible, false);
    executeAction(PSEvent.Select, desc1, dialogMode);
  };

  // Make
  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.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);
    var desc2 = new ActionDescriptor();
    desc2.putString(PSKey.Name, "S1");
    desc1.putObject(PSKey.Using, PSString.layerGroup, desc2);
    executeAction(PSEvent.Make, desc1, dialogMode);
  };

  step1();      // Make
  step2();      // Move
  step3();      // Set
  step4();      // Make
  step5();      // Set
  step6();      // Make
  step7();      // Set
  step8();      // Apply Image
  step9();      // Select
  step10();      // Select
  step11();      // Make
  step12();      // Set
  step13();      // Set
  step14();      // Duplicate
  step15();      // Delete
  step16();      // Set
  step17();      // Select
  step18();      // Set
  step19();      // Make
  step20();      // Set
  step21();      // Set
  step22();      // Delete
  step23();      // Set
  step24();      // Make
  step25();      // Set
  step26();      // Set
  step27();      // Move
  step28();      // Set
  step29();      // Make
  step30();      // Set
  step31();      // Set
  step32();      // Move
  step33();      // Select
  step34();      // Select
  step35();      // Select
  step36();      // Make
};



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

//
// S1.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.
//
S1.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.ColorBalance = cTID('ClrB');
  PSClass.ColorCorrection = cTID('ClrC');
  PSClass.ColorStop = cTID('Clrt');
  PSClass.Curves = cTID('Crvs');
  PSClass.CurvesAdjustment = cTID('CrvA');
  PSClass.Gradient = cTID('Grdn');
  PSClass.GradientMap = cTID('GdMp');
  PSClass.Layer = cTID('Lyr ');
  PSClass.Point = cTID('Pnt ');
  PSClass.RGBColor = cTID('RGBC');
  PSClass.SelectiveColor = cTID('SlcC');
  PSClass.TransparencyStop = cTID('TrnS');
  PSEnum.Absolute = cTID('Absl');
  PSEnum.All = cTID('Al  ');
  PSEnum.Backward = cTID('Bckw');
  PSEnum.Blocks = cTID('Blks');
  PSEnum.Blues = cTID('Bls ');
  PSEnum.Composite = cTID('Cmps');
  PSEnum.CustomStops = cTID('CstS');
  PSEnum.Cyans = cTID('Cyns');
  PSEnum.Exclusion = cTID('Xclu');
  PSEnum.Forward = cTID('Frwr');
  PSEnum.Front = cTID('Frnt');
  PSEnum.Greens = cTID('Grns');
  PSEnum.Magentas = cTID('Mgnt');
  PSEnum.Merged = cTID('Mrgd');
  PSEnum.Multiply = cTID('Mltp');
  PSEnum.Neutrals = cTID('Ntrl');
  PSEnum.None = cTID('None');
  PSEnum.Previous = cTID('Prvs');
  PSEnum.RGB = cTID('RGB ');
  PSEnum.Reds = cTID('Rds ');
  PSEnum.Target = cTID('Trgt');
  PSEnum.UserStop = cTID('UsrS');
  PSEnum.Whites = cTID('Whts');
  PSEnum.Yellows = cTID('Ylws');
  PSEvent.Delete = cTID('Dlt ');
  PSEvent.Duplicate = cTID('Dplc');
  PSEvent.Make = cTID('Mk  ');
  PSEvent.Move = cTID('move');
  PSEvent.Select = cTID('slct');
  PSEvent.Set = cTID('setd');
  PSEvent.Subtract = cTID('Sbtr');
  PSKey.Adjustment = cTID('Adjs');
  PSKey.Black = cTID('Blck');
  PSKey.Blue = cTID('Bl  ');
  PSKey.Calculation = cTID('Clcl');
  PSKey.Color = cTID('Clr ');
  PSKey.Colors = cTID('Clrs');
  PSKey.Curve = cTID('Crv ');
  PSKey.From = cTID('From');
  PSKey.Gradient = cTID('Grad');
  PSKey.Green = cTID('Grn ');
  PSKey.HighlightLevels = cTID('HghL');
  PSKey.Horizontal = cTID('Hrzn');
  PSKey.Interpolation = cTID('Intr');
  PSKey.Location = cTID('Lctn');
  PSKey.MakeVisible = cTID('MkVs');
  PSKey.Method = cTID('Mthd');
  PSKey.Midpoint = cTID('Mdpn');
  PSKey.MidtoneLevels = cTID('MdtL');
  PSKey.Mode = cTID('Md  ');
  PSKey.Name = cTID('Nm  ');
  PSKey.Opacity = cTID('Opct');
  PSKey.PreserveLuminosity = cTID('PrsL');
  PSKey.Red = cTID('Rd  ');
  PSKey.ShadowLevels = cTID('ShdL');
  PSKey.Start = cTID('Strt');
  PSKey.To = cTID('T   ');
  PSKey.Transparency = cTID('Trns');
  PSKey.Type = cTID('Type');
  PSKey.Using = cTID('Usng');
  PSKey.Vertical = cTID('Vrtc');
  PSKey.With = cTID('With');
  PSString.Null = sTID('null');
  PSString.addToSelection = sTID('addToSelection');
  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.Calculation = cTID('Clcn');
  PSType.ColorStopType = cTID('Clry');
  PSType.CorrectionMethod = cTID('CrcM');
  PSType.GradientForm = cTID('GrdF');
  PSType.Ordinal = cTID('Ordn');
  PSUnit.Percent = cTID('#Prc');
};

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



//=========================================
//                    S1.main
//=========================================
//

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

S1.main();

// EOF

    },
};

$._ext_S2={
    run : function() {
//
// Generated Thu Aug 20 2015 16:05:15 GMT+0400
//

//
//==================== S2 ==============
//
function S2() {
  // 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.AdjustmentLayer);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    desc2.putString(PSKey.Name, "SelectiveColor");
    var desc3 = new ActionDescriptor();
    desc3.putEnumerated(PSString.presetKind, PSString.presetKindType, PSString.presetKindDefault);
    desc2.putObject(PSKey.Type, PSClass.SelectiveColor, desc3);
    desc1.putObject(PSKey.Using, PSClass.AdjustmentLayer, desc2);
    executeAction(PSEvent.Make, desc1, dialogMode);
  };

  // Move
  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 ref2 = new ActionReference();
    ref2.putEnumerated(PSClass.Layer, PSType.Ordinal, PSEnum.Front);
    desc1.putReference(PSKey.To, ref2);
    executeAction(PSEvent.Move, 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.AdjustmentLayer, PSType.Ordinal, PSEnum.Target);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    desc2.putEnumerated(PSString.presetKind, PSString.presetKindType, PSString.presetKindCustom);
    desc2.putEnumerated(PSKey.Method, PSType.CorrectionMethod, PSEnum.Absolute);
    var list1 = new ActionList();
    var desc3 = new ActionDescriptor();
    desc3.putEnumerated(PSKey.Colors, PSKey.Colors, PSEnum.Reds);
    desc3.putUnitDouble(PSKey.Black, PSUnit.Percent, -100);
    list1.putObject(PSClass.ColorCorrection, desc3);
    var desc4 = new ActionDescriptor();
    desc4.putEnumerated(PSKey.Colors, PSKey.Colors, PSEnum.Yellows);
    desc4.putUnitDouble(PSKey.Black, PSUnit.Percent, -100);
    list1.putObject(PSClass.ColorCorrection, desc4);
    var desc5 = new ActionDescriptor();
    desc5.putEnumerated(PSKey.Colors, PSKey.Colors, PSEnum.Greens);
    desc5.putUnitDouble(PSKey.Black, PSUnit.Percent, -100);
    list1.putObject(PSClass.ColorCorrection, desc5);
    var desc6 = new ActionDescriptor();
    desc6.putEnumerated(PSKey.Colors, PSKey.Colors, PSEnum.Cyans);
    desc6.putUnitDouble(PSKey.Black, PSUnit.Percent, -100);
    list1.putObject(PSClass.ColorCorrection, desc6);
    var desc7 = new ActionDescriptor();
    desc7.putEnumerated(PSKey.Colors, PSKey.Colors, PSEnum.Blues);
    desc7.putUnitDouble(PSKey.Black, PSUnit.Percent, -100);
    list1.putObject(PSClass.ColorCorrection, desc7);
    var desc8 = new ActionDescriptor();
    desc8.putEnumerated(PSKey.Colors, PSKey.Colors, PSEnum.Magentas);
    desc8.putUnitDouble(PSKey.Black, PSUnit.Percent, -100);
    list1.putObject(PSClass.ColorCorrection, desc8);
    var desc9 = new ActionDescriptor();
    desc9.putEnumerated(PSKey.Colors, PSKey.Colors, PSEnum.Whites);
    desc9.putUnitDouble(PSKey.Black, PSUnit.Percent, 100);
    list1.putObject(PSClass.ColorCorrection, desc9);
    var desc10 = new ActionDescriptor();
    desc10.putEnumerated(PSKey.Colors, PSKey.Colors, PSEnum.Neutrals);
    desc10.putUnitDouble(PSKey.Black, PSUnit.Percent, 100);
    list1.putObject(PSClass.ColorCorrection, desc10);
    var desc11 = new ActionDescriptor();
    desc11.putEnumerated(PSKey.Colors, PSKey.Colors, PSEnum.Blocks);
    desc11.putUnitDouble(PSKey.Black, PSUnit.Percent, 100);
    list1.putObject(PSClass.ColorCorrection, desc11);
    desc2.putList(PSClass.ColorCorrection, list1);
    desc1.putObject(PSKey.To, PSClass.SelectiveColor, 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.AdjustmentLayer);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    desc2.putString(PSKey.Name, "ContrastForMask");
    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);
  };

  // Set
  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.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, 0);
    desc4.putDouble(PSKey.Vertical, 0);
    list2.putObject(PSClass.Point, desc4);
    var desc5 = new ActionDescriptor();
    desc5.putDouble(PSKey.Horizontal, 128);
    desc5.putDouble(PSKey.Vertical, 255);
    list2.putObject(PSClass.Point, desc5);
    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);
  };

  // Make
  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);
  };

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

  // Apply Image
  function step8(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);
    desc2.putEnumerated(PSKey.Calculation, PSType.Calculation, PSEnum.Multiply);
    desc1.putObject(PSKey.With, PSKey.Calculation, desc2);
    executeAction(sTID('applyImageEvent'), desc1, dialogMode);
  };

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

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

  // Make
  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.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);
  };

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

  // Set
  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.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSString.Null, ref1);
    var ref2 = new ActionReference();
    ref2.putEnumerated(PSClass.Channel, PSClass.Channel, PSEnum.RGB);
    desc1.putReference(PSKey.To, ref2);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

  // Duplicate
  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.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSString.Null, ref1);
    desc1.putString(PSKey.Name, "SaturnMask");
    executeAction(PSEvent.Duplicate, desc1, dialogMode);
  };

  // Delete
  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.Layer, PSType.Ordinal, PSEnum.Target);
    desc1.putReference(PSString.Null, ref1);
    executeAction(PSEvent.Delete, 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.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSString.Null, ref1);
    desc1.putEnumerated(PSKey.To, PSType.Ordinal, PSEnum.None);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

  // Select
  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.Channel, PSClass.Channel, PSEnum.RGB);
    desc1.putReference(PSString.Null, ref1);
    executeAction(PSEvent.Select, 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.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSString.Null, ref1);
    var ref2 = new ActionReference();
    ref2.putName(PSClass.Channel, "SaturnMask");
    desc1.putReference(PSKey.To, ref2);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

  // Make
  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();
    desc2.putString(PSKey.Name, "Desaturate heavily saturated");
    desc2.putClass(PSKey.Type, sTID("vibrance"));
    desc1.putObject(PSKey.Using, PSClass.AdjustmentLayer, desc2);
    executeAction(PSEvent.Make, desc1, dialogMode);
  };

  // Set
  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.Layer, PSType.Ordinal, PSEnum.Target);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    desc2.putUnitDouble(PSKey.Opacity, PSUnit.Percent, 50);
    desc1.putObject(PSKey.To, PSClass.Layer, desc2);
    executeAction(PSEvent.Set, 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.AdjustmentLayer, PSType.Ordinal, PSEnum.Target);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    desc2.putInteger(PSKey.Start, -50);
    desc1.putObject(PSKey.To, sTID("vibrance"), desc2);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

  // Delete
  function step22(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var desc1 = new ActionDescriptor();
    var ref1 = new ActionReference();
    ref1.putName(PSClass.Channel, "SaturnMask");
    desc1.putReference(PSString.Null, ref1);
    executeAction(PSEvent.Delete, desc1, dialogMode);
  };

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

  // Make
  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.putClass(PSClass.AdjustmentLayer);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    desc2.putString(PSKey.Name, "Grading A2");
    var desc3 = new ActionDescriptor();
    var desc4 = new ActionDescriptor();
    desc4.putString(PSKey.Name, "Foreground to Background");
    desc4.putEnumerated(PSType.GradientForm, PSType.GradientForm, PSEnum.CustomStops);
    desc4.putDouble(PSKey.Interpolation, 4096);
    var list1 = new ActionList();
    var desc5 = new ActionDescriptor();
    var desc6 = new ActionDescriptor();
    desc6.putDouble(PSKey.Red, 177.000004649162);
    desc6.putDouble(PSKey.Green, 187.9961130023);
    desc6.putDouble(PSKey.Blue, 187.9961130023);
    desc5.putObject(PSKey.Color, PSClass.RGBColor, desc6);
    desc5.putEnumerated(PSKey.Type, PSType.ColorStopType, PSEnum.UserStop);
    desc5.putInteger(PSKey.Location, 0);
    desc5.putInteger(PSKey.Midpoint, 50);
    list1.putObject(PSClass.ColorStop, desc5);
    var desc7 = new ActionDescriptor();
    var desc8 = new ActionDescriptor();
    desc8.putDouble(PSKey.Red, 0);
    desc8.putDouble(PSKey.Green, 0);
    desc8.putDouble(PSKey.Blue, 0);
    desc7.putObject(PSKey.Color, PSClass.RGBColor, desc8);
    desc7.putEnumerated(PSKey.Type, PSType.ColorStopType, PSEnum.UserStop);
    desc7.putInteger(PSKey.Location, 4096);
    desc7.putInteger(PSKey.Midpoint, 50);
    list1.putObject(PSClass.ColorStop, desc7);
    desc4.putList(PSKey.Colors, list1);
    var list2 = new ActionList();
    var desc9 = new ActionDescriptor();
    desc9.putUnitDouble(PSKey.Opacity, PSUnit.Percent, 100);
    desc9.putInteger(PSKey.Location, 0);
    desc9.putInteger(PSKey.Midpoint, 50);
    list2.putObject(PSClass.TransparencyStop, desc9);
    var desc10 = new ActionDescriptor();
    desc10.putUnitDouble(PSKey.Opacity, PSUnit.Percent, 100);
    desc10.putInteger(PSKey.Location, 4096);
    desc10.putInteger(PSKey.Midpoint, 50);
    list2.putObject(PSClass.TransparencyStop, desc10);
    desc4.putList(PSKey.Transparency, list2);
    desc3.putObject(PSKey.Gradient, PSClass.Gradient, desc4);
    desc2.putObject(PSKey.Type, PSClass.GradientMap, desc3);
    desc1.putObject(PSKey.Using, PSClass.AdjustmentLayer, desc2);
    executeAction(PSEvent.Make, desc1, dialogMode);
  };

  // Select
  function step25(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var desc1 = new ActionDescriptor();
    var ref1 = new ActionReference();
    ref1.putEnumerated(PSClass.Channel, PSClass.Channel, PSEnum.RGB);
    desc1.putReference(PSString.Null, ref1);
    desc1.putBoolean(PSKey.MakeVisible, false);
    executeAction(PSEvent.Select, 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.AdjustmentLayer, PSType.Ordinal, PSEnum.Target);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    var desc3 = new ActionDescriptor();
    desc3.putString(PSKey.Name, "Custom");
    desc3.putEnumerated(PSType.GradientForm, PSType.GradientForm, PSEnum.CustomStops);
    desc3.putDouble(PSKey.Interpolation, 4096);
    var list1 = new ActionList();
    var desc4 = new ActionDescriptor();
    var desc5 = new ActionDescriptor();
    desc5.putDouble(PSKey.Red, 63.7509727478027);
    desc5.putDouble(PSKey.Green, 29.7509728744626);
    desc5.putDouble(PSKey.Blue, 12.7509729377925);
    desc4.putObject(PSKey.Color, PSClass.RGBColor, desc5);
    desc4.putEnumerated(PSKey.Type, PSType.ColorStopType, PSEnum.UserStop);
    desc4.putInteger(PSKey.Location, 0);
    desc4.putInteger(PSKey.Midpoint, 50);
    list1.putObject(PSClass.ColorStop, desc4);
    var desc6 = new ActionDescriptor();
    var desc7 = new ActionDescriptor();
    desc7.putDouble(PSKey.Red, 121.587547659874);
    desc7.putDouble(PSKey.Green, 187.229572534561);
    desc7.putDouble(PSKey.Blue, 195.000003576279);
    desc6.putObject(PSKey.Color, PSClass.RGBColor, desc7);
    desc6.putEnumerated(PSKey.Type, PSType.ColorStopType, PSEnum.UserStop);
    desc6.putInteger(PSKey.Location, 3352);
    desc6.putInteger(PSKey.Midpoint, 66);
    list1.putObject(PSClass.ColorStop, desc6);
    var desc8 = new ActionDescriptor();
    var desc9 = new ActionDescriptor();
    desc9.putDouble(PSKey.Red, 127.988319396973);
    desc9.putDouble(PSKey.Green, 239.778214395046);
    desc9.putDouble(PSKey.Blue, 253.000000119209);
    desc8.putObject(PSKey.Color, PSClass.RGBColor, desc9);
    desc8.putEnumerated(PSKey.Type, PSType.ColorStopType, PSEnum.UserStop);
    desc8.putInteger(PSKey.Location, 4096);
    desc8.putInteger(PSKey.Midpoint, 50);
    list1.putObject(PSClass.ColorStop, desc8);
    desc3.putList(PSKey.Colors, list1);
    var list2 = new ActionList();
    var desc10 = new ActionDescriptor();
    desc10.putUnitDouble(PSKey.Opacity, PSUnit.Percent, 100);
    desc10.putInteger(PSKey.Location, 0);
    desc10.putInteger(PSKey.Midpoint, 50);
    list2.putObject(PSClass.TransparencyStop, desc10);
    var desc11 = new ActionDescriptor();
    desc11.putUnitDouble(PSKey.Opacity, PSUnit.Percent, 100);
    desc11.putInteger(PSKey.Location, 4096);
    desc11.putInteger(PSKey.Midpoint, 50);
    list2.putObject(PSClass.TransparencyStop, desc11);
    desc3.putList(PSKey.Transparency, list2);
    desc2.putObject(PSKey.Gradient, PSClass.Gradient, desc3);
    desc1.putObject(PSKey.To, PSClass.GradientMap, 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.putUnitDouble(PSKey.Opacity, PSUnit.Percent, 20);
    desc1.putObject(PSKey.To, PSClass.Layer, desc2);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

  // Move
  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 ref2 = new ActionReference();
    ref2.putEnumerated(PSClass.Layer, PSType.Ordinal, PSEnum.Front);
    desc1.putReference(PSKey.To, ref2);
    executeAction(PSEvent.Move, desc1, dialogMode);
  };

  // Make
  function step29(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var desc1 = new ActionDescriptor();
    var ref1 = new ActionReference();
    ref1.putClass(PSString.contentLayer);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    desc2.putString(PSKey.Name, "Desaturation A2");
    var desc3 = new ActionDescriptor();
    var desc4 = new ActionDescriptor();
    desc4.putDouble(PSKey.Red, 127.501945495605);
    desc4.putDouble(PSKey.Green, 127.501945495605);
    desc4.putDouble(PSKey.Blue, 127.501945495605);
    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 step30(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var desc1 = new ActionDescriptor();
    var ref1 = new ActionReference();
    ref1.putEnumerated(PSClass.Layer, PSType.Ordinal, PSEnum.Target);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    desc2.putEnumerated(PSKey.Mode, PSType.BlendMode, PSKey.Color);
    desc1.putObject(PSKey.To, PSClass.Layer, desc2);
    executeAction(PSEvent.Set, 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.Layer, PSType.Ordinal, PSEnum.Target);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    desc2.putUnitDouble(PSKey.Opacity, PSUnit.Percent, 15);
    desc1.putObject(PSKey.To, PSClass.Layer, desc2);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

  // Move
  function step32(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var desc1 = new ActionDescriptor();
    var ref1 = new ActionReference();
    ref1.putEnumerated(PSClass.Layer, PSType.Ordinal, PSEnum.Target);
    desc1.putReference(PSString.Null, ref1);
    var ref2 = new ActionReference();
    ref2.putEnumerated(PSClass.Layer, PSType.Ordinal, PSEnum.Previous);
    desc1.putReference(PSKey.To, ref2);
    executeAction(PSEvent.Move, desc1, dialogMode);
  };

  // Set
  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.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSString.Null, ref1);
    var ref2 = new ActionReference();
    ref2.putEnumerated(PSClass.Channel, PSClass.Channel, PSEnum.RGB);
    desc1.putReference(PSKey.To, ref2);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

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

  // Deselect
  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, PSEnum.RGB);
    desc1.putReference(PSString.Null, ref1);
    executeAction(PSEvent.Deselect, desc1, dialogMode);
  };

  // Make
  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.putClass(PSClass.AdjustmentLayer);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    desc2.putString(PSKey.Name, "Photo Filter A2");
    var desc3 = new ActionDescriptor();
    var desc4 = new ActionDescriptor();
    desc4.putDouble(PSKey.Luminance, 67.06);
    desc4.putDouble(PSString.a, 32);
    desc4.putDouble(PSString.b, 120);
    desc3.putObject(PSKey.Color, PSClass.LabColor, desc4);
    desc3.putInteger(PSKey.Density, 25);
    desc3.putBoolean(PSKey.PreserveLuminosity, false);
    desc2.putObject(PSKey.Type, PSString.photoFilter, desc3);
    desc1.putObject(PSKey.Using, PSClass.AdjustmentLayer, desc2);
    executeAction(PSEvent.Make, desc1, dialogMode);
  };

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

  // Select
  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.Channel, PSClass.Channel, PSEnum.RGB);
    desc1.putReference(PSString.Null, ref1);
    desc1.putBoolean(PSKey.MakeVisible, false);
    executeAction(PSEvent.Select, desc1, 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.AdjustmentLayer, PSType.Ordinal, PSEnum.Target);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    var desc3 = new ActionDescriptor();
    desc3.putUnitDouble(PSKey.Hue, PSUnit.Angle, 35.00244140625);
    desc3.putDouble(PSKey.Start, 100);
    desc3.putDouble(PSKey.Brightness, 91.9996948195621);
    desc2.putObject(PSKey.Color, PSClass.HSBColor, desc3);
    desc1.putObject(PSKey.To, PSString.photoFilter, 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.putEnumerated(PSClass.Layer, PSType.Ordinal, PSEnum.Forward);
    desc1.putReference(PSString.Null, ref1);
    desc1.putBoolean(PSKey.MakeVisible, false);
    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.Layer, PSType.Ordinal, PSEnum.Backward);
    desc1.putReference(PSString.Null, ref1);
    desc1.putEnumerated(PSString.selectionModifier, PSString.selectionModifierType, PSString.addToSelection);
    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.putEnumerated(PSClass.Layer, PSType.Ordinal, PSEnum.Backward);
    desc1.putReference(PSString.Null, ref1);
    desc1.putEnumerated(PSString.selectionModifier, PSString.selectionModifierType, PSString.addToSelection);
    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.putEnumerated(PSClass.Layer, PSType.Ordinal, PSEnum.Backward);
    desc1.putReference(PSString.Null, ref1);
    desc1.putEnumerated(PSString.selectionModifier, PSString.selectionModifierType, PSString.addToSelection);
    desc1.putBoolean(PSKey.MakeVisible, false);
    executeAction(PSEvent.Select, desc1, dialogMode);
  };

  // Make
  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.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);
    var desc2 = new ActionDescriptor();
    desc2.putString(PSKey.Name, "S2");
    desc1.putObject(PSKey.Using, PSString.layerGroup, desc2);
    executeAction(PSEvent.Make, desc1, dialogMode);
  };

  step1();      // Make
  step2();      // Move
  step3();      // Set
  step4();      // Make
  step5();      // Set
  step6();      // Make
  step7();      // Set
  step8();      // Apply Image
  step9();      // Select
  step10();      // Select
  step11();      // Make
  step12();      // Set
  step13();      // Set
  step14();      // Duplicate
  step15();      // Delete
  step16();      // Set
  step17();      // Select
  step18();      // Set
  step19();      // Make
  step20();      // Set
  step21();      // Set
  step22();      // Delete
  step23();      // Set
  step24();      // Make
  step25();      // Select
  step26();      // Set
  step27();      // Set
  step28();      // Move
  step29();      // Make
  step30();      // Set
  step31();      // Set
  step32();      // Move
  step33();      // Set
  step34();      // Deselect
  step35();      // Deselect
  step36();      // Make
  step37();      // Invert
  step38();      // Select
  step39();      // Set
  step40();      // Select
  step41();      // Select
  step42();      // Select
  step43();      // Select
  step44();      // Make
};



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

//
// S2.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.
//
S2.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.ColorBalance = cTID('ClrB');
  PSClass.ColorCorrection = cTID('ClrC');
  PSClass.ColorStop = cTID('Clrt');
  PSClass.Curves = cTID('Crvs');
  PSClass.CurvesAdjustment = cTID('CrvA');
  PSClass.Gradient = cTID('Grdn');
  PSClass.GradientMap = cTID('GdMp');
  PSClass.HSBColor = cTID('HSBC');
  PSClass.LabColor = cTID('LbCl');
  PSClass.Layer = cTID('Lyr ');
  PSClass.Point = cTID('Pnt ');
  PSClass.RGBColor = cTID('RGBC');
  PSClass.SelectiveColor = cTID('SlcC');
  PSClass.TransparencyStop = cTID('TrnS');
  PSEnum.Absolute = cTID('Absl');
  PSEnum.All = cTID('Al  ');
  PSEnum.Backward = cTID('Bckw');
  PSEnum.Blocks = cTID('Blks');
  PSEnum.Blues = cTID('Bls ');
  PSEnum.Composite = cTID('Cmps');
  PSEnum.CustomStops = cTID('CstS');
  PSEnum.Cyans = cTID('Cyns');
  PSEnum.Exclusion = cTID('Xclu');
  PSEnum.Forward = cTID('Frwr');
  PSEnum.Front = cTID('Frnt');
  PSEnum.Greens = cTID('Grns');
  PSEnum.Magentas = cTID('Mgnt');
  PSEnum.Merged = cTID('Mrgd');
  PSEnum.Multiply = cTID('Mltp');
  PSEnum.Neutrals = cTID('Ntrl');
  PSEnum.None = cTID('None');
  PSEnum.Previous = cTID('Prvs');
  PSEnum.RGB = cTID('RGB ');
  PSEnum.Reds = cTID('Rds ');
  PSEnum.Target = cTID('Trgt');
  PSEnum.UserStop = cTID('UsrS');
  PSEnum.Whites = cTID('Whts');
  PSEnum.Yellows = cTID('Ylws');
  PSEvent.Delete = cTID('Dlt ');
  PSEvent.Deselect = cTID('Dslc');
  PSEvent.Duplicate = cTID('Dplc');
  PSEvent.Invert = cTID('Invr');
  PSEvent.Make = cTID('Mk  ');
  PSEvent.Move = cTID('move');
  PSEvent.Select = cTID('slct');
  PSEvent.Set = cTID('setd');
  PSEvent.Subtract = cTID('Sbtr');
  PSKey.Adjustment = cTID('Adjs');
  PSKey.Black = cTID('Blck');
  PSKey.Blue = cTID('Bl  ');
  PSKey.Brightness = cTID('Brgh');
  PSKey.Calculation = cTID('Clcl');
  PSKey.Color = cTID('Clr ');
  PSKey.Colors = cTID('Clrs');
  PSKey.Curve = cTID('Crv ');
  PSKey.Density = cTID('Dnst');
  PSKey.From = cTID('From');
  PSKey.Gradient = cTID('Grad');
  PSKey.Green = cTID('Grn ');
  PSKey.HighlightLevels = cTID('HghL');
  PSKey.Horizontal = cTID('Hrzn');
  PSKey.Hue = cTID('H   ');
  PSKey.Interpolation = cTID('Intr');
  PSKey.Location = cTID('Lctn');
  PSKey.Luminance = cTID('Lmnc');
  PSKey.MakeVisible = cTID('MkVs');
  PSKey.Method = cTID('Mthd');
  PSKey.Midpoint = cTID('Mdpn');
  PSKey.MidtoneLevels = cTID('MdtL');
  PSKey.Mode = cTID('Md  ');
  PSKey.Name = cTID('Nm  ');
  PSKey.Opacity = cTID('Opct');
  PSKey.PreserveLuminosity = cTID('PrsL');
  PSKey.Red = cTID('Rd  ');
  PSKey.ShadowLevels = cTID('ShdL');
  PSKey.Start = cTID('Strt');
  PSKey.To = cTID('T   ');
  PSKey.Transparency = cTID('Trns');
  PSKey.Type = cTID('Type');
  PSKey.Using = cTID('Usng');
  PSKey.Vertical = cTID('Vrtc');
  PSKey.With = cTID('With');
  PSString.Null = sTID('null');
  PSString.a = sTID('a');
  PSString.addToSelection = sTID('addToSelection');
  PSString.b = sTID('b');
  PSString.contentLayer = sTID('contentLayer');
  PSString.layerGroup = sTID('layerSection');
  PSString.photoFilter = sTID('photoFilter');
  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.Calculation = cTID('Clcn');
  PSType.ColorStopType = cTID('Clry');
  PSType.CorrectionMethod = cTID('CrcM');
  PSType.GradientForm = cTID('GrdF');
  PSType.Ordinal = cTID('Ordn');
  PSUnit.Angle = cTID('#Ang');
  PSUnit.Percent = cTID('#Prc');
};

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



//=========================================
//                    S2.main
//=========================================
//

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

S2.main();

// EOF

    },
};

$._ext_S3={
    run : function() {
//
// Generated Thu Aug 20 2015 16:05:15 GMT+0400
//

//
//==================== S3 ==============
//
function S3() {
  // 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.AdjustmentLayer);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    desc2.putString(PSKey.Name, "SelectiveColor");
    var desc3 = new ActionDescriptor();
    desc3.putEnumerated(PSString.presetKind, PSString.presetKindType, PSString.presetKindDefault);
    desc2.putObject(PSKey.Type, PSClass.SelectiveColor, desc3);
    desc1.putObject(PSKey.Using, PSClass.AdjustmentLayer, desc2);
    executeAction(PSEvent.Make, desc1, dialogMode);
  };

  // Move
  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 ref2 = new ActionReference();
    ref2.putEnumerated(PSClass.Layer, PSType.Ordinal, PSEnum.Front);
    desc1.putReference(PSKey.To, ref2);
    executeAction(PSEvent.Move, 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.AdjustmentLayer, PSType.Ordinal, PSEnum.Target);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    desc2.putEnumerated(PSString.presetKind, PSString.presetKindType, PSString.presetKindCustom);
    desc2.putEnumerated(PSKey.Method, PSType.CorrectionMethod, PSEnum.Absolute);
    var list1 = new ActionList();
    var desc3 = new ActionDescriptor();
    desc3.putEnumerated(PSKey.Colors, PSKey.Colors, PSEnum.Reds);
    desc3.putUnitDouble(PSKey.Black, PSUnit.Percent, -100);
    list1.putObject(PSClass.ColorCorrection, desc3);
    var desc4 = new ActionDescriptor();
    desc4.putEnumerated(PSKey.Colors, PSKey.Colors, PSEnum.Yellows);
    desc4.putUnitDouble(PSKey.Black, PSUnit.Percent, -100);
    list1.putObject(PSClass.ColorCorrection, desc4);
    var desc5 = new ActionDescriptor();
    desc5.putEnumerated(PSKey.Colors, PSKey.Colors, PSEnum.Greens);
    desc5.putUnitDouble(PSKey.Black, PSUnit.Percent, -100);
    list1.putObject(PSClass.ColorCorrection, desc5);
    var desc6 = new ActionDescriptor();
    desc6.putEnumerated(PSKey.Colors, PSKey.Colors, PSEnum.Cyans);
    desc6.putUnitDouble(PSKey.Black, PSUnit.Percent, -100);
    list1.putObject(PSClass.ColorCorrection, desc6);
    var desc7 = new ActionDescriptor();
    desc7.putEnumerated(PSKey.Colors, PSKey.Colors, PSEnum.Blues);
    desc7.putUnitDouble(PSKey.Black, PSUnit.Percent, -100);
    list1.putObject(PSClass.ColorCorrection, desc7);
    var desc8 = new ActionDescriptor();
    desc8.putEnumerated(PSKey.Colors, PSKey.Colors, PSEnum.Magentas);
    desc8.putUnitDouble(PSKey.Black, PSUnit.Percent, -100);
    list1.putObject(PSClass.ColorCorrection, desc8);
    var desc9 = new ActionDescriptor();
    desc9.putEnumerated(PSKey.Colors, PSKey.Colors, PSEnum.Whites);
    desc9.putUnitDouble(PSKey.Black, PSUnit.Percent, 100);
    list1.putObject(PSClass.ColorCorrection, desc9);
    var desc10 = new ActionDescriptor();
    desc10.putEnumerated(PSKey.Colors, PSKey.Colors, PSEnum.Neutrals);
    desc10.putUnitDouble(PSKey.Black, PSUnit.Percent, 100);
    list1.putObject(PSClass.ColorCorrection, desc10);
    var desc11 = new ActionDescriptor();
    desc11.putEnumerated(PSKey.Colors, PSKey.Colors, PSEnum.Blocks);
    desc11.putUnitDouble(PSKey.Black, PSUnit.Percent, 100);
    list1.putObject(PSClass.ColorCorrection, desc11);
    desc2.putList(PSClass.ColorCorrection, list1);
    desc1.putObject(PSKey.To, PSClass.SelectiveColor, 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.AdjustmentLayer);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    desc2.putString(PSKey.Name, "ContrastForMask");
    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);
  };

  // Set
  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.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, 0);
    desc4.putDouble(PSKey.Vertical, 0);
    list2.putObject(PSClass.Point, desc4);
    var desc5 = new ActionDescriptor();
    desc5.putDouble(PSKey.Horizontal, 128);
    desc5.putDouble(PSKey.Vertical, 255);
    list2.putObject(PSClass.Point, desc5);
    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);
  };

  // Make
  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);
  };

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

  // Apply Image
  function step8(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);
    desc2.putEnumerated(PSKey.Calculation, PSType.Calculation, PSEnum.Multiply);
    desc1.putObject(PSKey.With, PSKey.Calculation, desc2);
    executeAction(sTID('applyImageEvent'), desc1, dialogMode);
  };

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

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

  // Make
  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.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);
  };

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

  // Set
  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.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSString.Null, ref1);
    var ref2 = new ActionReference();
    ref2.putEnumerated(PSClass.Channel, PSClass.Channel, PSEnum.RGB);
    desc1.putReference(PSKey.To, ref2);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

  // Duplicate
  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.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSString.Null, ref1);
    desc1.putString(PSKey.Name, "SaturnMask");
    executeAction(PSEvent.Duplicate, desc1, dialogMode);
  };

  // Delete
  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.Layer, PSType.Ordinal, PSEnum.Target);
    desc1.putReference(PSString.Null, ref1);
    executeAction(PSEvent.Delete, 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.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSString.Null, ref1);
    desc1.putEnumerated(PSKey.To, PSType.Ordinal, PSEnum.None);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

  // Select
  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.Channel, PSClass.Channel, PSEnum.RGB);
    desc1.putReference(PSString.Null, ref1);
    executeAction(PSEvent.Select, 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.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSString.Null, ref1);
    var ref2 = new ActionReference();
    ref2.putName(PSClass.Channel, "SaturnMask");
    desc1.putReference(PSKey.To, ref2);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

  // Make
  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();
    desc2.putString(PSKey.Name, "Desaturate heavily saturated");
    desc2.putClass(PSKey.Type, sTID("vibrance"));
    desc1.putObject(PSKey.Using, PSClass.AdjustmentLayer, desc2);
    executeAction(PSEvent.Make, desc1, dialogMode);
  };

  // Set
  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.Layer, PSType.Ordinal, PSEnum.Target);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    desc2.putUnitDouble(PSKey.Opacity, PSUnit.Percent, 50);
    desc1.putObject(PSKey.To, PSClass.Layer, desc2);
    executeAction(PSEvent.Set, 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.AdjustmentLayer, PSType.Ordinal, PSEnum.Target);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    desc2.putInteger(PSKey.Start, -50);
    desc1.putObject(PSKey.To, sTID("vibrance"), desc2);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

  // Delete
  function step22(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var desc1 = new ActionDescriptor();
    var ref1 = new ActionReference();
    ref1.putName(PSClass.Channel, "SaturnMask");
    desc1.putReference(PSString.Null, ref1);
    executeAction(PSEvent.Delete, desc1, dialogMode);
  };

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

  // Set
  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.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSString.Null, ref1);
    var ref2 = new ActionReference();
    ref2.putEnumerated(PSClass.Channel, PSClass.Channel, PSEnum.RGB);
    desc1.putReference(PSKey.To, ref2);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

  // Intersect
  function step25(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var desc1 = new ActionDescriptor();
    var ref1 = new ActionReference();
    ref1.putEnumerated(PSClass.Channel, PSClass.Channel, PSEnum.RGB);
    desc1.putReference(PSString.Null, ref1);
    var ref2 = new ActionReference();
    ref2.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSKey.With, ref2);
    executeAction(PSEvent.Intersect, desc1, dialogMode);
  };

  // Make
  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.putClass(PSClass.AdjustmentLayer);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    desc2.putString(PSKey.Name, "A3 Lights");
    var desc3 = new ActionDescriptor();
    var list1 = new ActionList();
    list1.putInteger(0);
    list1.putInteger(sTID("skinTone"), 0);
    list1.putInteger(sTID("contentAware"), 0);
    desc3.putList(PSKey.ShadowLevels, list1);
    var list2 = new ActionList();
    list2.putInteger(0);
    list2.putInteger(sTID("skinTone"), 0);
    list2.putInteger(sTID("contentAware"), 0);
    desc3.putList(PSKey.MidtoneLevels, list2);
    var list3 = new ActionList();
    list3.putInteger(0);
    list3.putInteger(sTID("skinTone"), 0);
    list3.putInteger(sTID("contentAware"), 0);
    desc3.putList(PSKey.HighlightLevels, list3);
    desc3.putBoolean(PSKey.PreserveLuminosity, true);
    desc2.putObject(PSKey.Type, PSClass.ColorBalance, desc3);
    desc1.putObject(PSKey.Using, PSClass.AdjustmentLayer, desc2);
    executeAction(PSEvent.Make, 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.AdjustmentLayer, PSType.Ordinal, PSEnum.Target);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    var list1 = new ActionList();
    list1.putInteger(-10);
    list1.putInteger(sTID("skinTone"), 10);
    list1.putInteger(sTID("contentAware"), 10);
    desc2.putList(PSKey.MidtoneLevels, list1);
    var list2 = new ActionList();
    list2.putInteger(-10);
    list2.putInteger(sTID("skinTone"), 0);
    list2.putInteger(sTID("contentAware"), 25);
    desc2.putList(PSKey.HighlightLevels, list2);
    desc1.putObject(PSKey.To, PSClass.ColorBalance, desc2);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

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

  // Set
  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.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSString.Null, ref1);
    desc1.putEnumerated(PSKey.To, PSType.Ordinal, PSEnum.All);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

  // Subtract
  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);
    var ref2 = new ActionReference();
    ref2.putProperty(PSClass.Channel, PSString.selection);
    desc1.putReference(PSKey.From, ref2);
    executeAction(PSEvent.Subtract, desc1, dialogMode);
  };

  // Make
  function step31(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var desc1 = new ActionDescriptor();
    var ref1 = new ActionReference();
    ref1.putClass(PSClass.AdjustmentLayer);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    desc2.putString(PSKey.Name, "A3 Shadows");
    var desc3 = new ActionDescriptor();
    var list1 = new ActionList();
    list1.putInteger(0);
    list1.putInteger(sTID("skinTone"), 0);
    list1.putInteger(sTID("contentAware"), 0);
    desc3.putList(PSKey.ShadowLevels, list1);
    var list2 = new ActionList();
    list2.putInteger(0);
    list2.putInteger(sTID("skinTone"), 0);
    list2.putInteger(sTID("contentAware"), 0);
    desc3.putList(PSKey.MidtoneLevels, list2);
    var list3 = new ActionList();
    list3.putInteger(0);
    list3.putInteger(sTID("skinTone"), 0);
    list3.putInteger(sTID("contentAware"), 0);
    desc3.putList(PSKey.HighlightLevels, list3);
    desc3.putBoolean(PSKey.PreserveLuminosity, true);
    desc2.putObject(PSKey.Type, PSClass.ColorBalance, desc3);
    desc1.putObject(PSKey.Using, PSClass.AdjustmentLayer, desc2);
    executeAction(PSEvent.Make, desc1, dialogMode);
  };

  // Set
  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.AdjustmentLayer, PSType.Ordinal, PSEnum.Target);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    var list1 = new ActionList();
    list1.putInteger(15);
    list1.putInteger(sTID("skinTone"), 0);
    list1.putInteger(sTID("contentAware"), -5);
    desc2.putList(PSKey.ShadowLevels, list1);
    var list2 = new ActionList();
    list2.putInteger(15);
    list2.putInteger(sTID("skinTone"), 0);
    list2.putInteger(sTID("contentAware"), 0);
    desc2.putList(PSKey.MidtoneLevels, list2);
    desc1.putObject(PSKey.To, PSClass.ColorBalance, desc2);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

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

  // Move
  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 ref2 = new ActionReference();
    ref2.putEnumerated(PSClass.Layer, PSType.Ordinal, PSEnum.Previous);
    desc1.putReference(PSKey.To, ref2);
    executeAction(PSEvent.Move, desc1, dialogMode);
  };

  // Make
  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.putClass(PSString.contentLayer);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    desc2.putString(PSKey.Name, "Desaturation A3");
    var desc3 = new ActionDescriptor();
    var desc4 = new ActionDescriptor();
    desc4.putDouble(PSKey.Red, 127.501945495605);
    desc4.putDouble(PSKey.Green, 127.501945495605);
    desc4.putDouble(PSKey.Blue, 127.501945495605);
    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 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, PSKey.Color);
    desc1.putObject(PSKey.To, PSClass.Layer, desc2);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

  // Set
  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.putUnitDouble(PSKey.Opacity, PSUnit.Percent, 15);
    desc1.putObject(PSKey.To, PSClass.Layer, desc2);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

  // Move
  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 ref2 = new ActionReference();
    ref2.putEnumerated(PSClass.Layer, PSType.Ordinal, PSEnum.Previous);
    desc1.putReference(PSKey.To, ref2);
    executeAction(PSEvent.Move, desc1, dialogMode);
  };

  // Select
  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.Forward);
    desc1.putReference(PSString.Null, ref1);
    desc1.putBoolean(PSKey.MakeVisible, false);
    executeAction(PSEvent.Select, 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.putEnumerated(PSClass.Layer, PSType.Ordinal, PSEnum.Forward);
    desc1.putReference(PSString.Null, ref1);
    desc1.putBoolean(PSKey.MakeVisible, false);
    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.Layer, PSType.Ordinal, PSEnum.Backward);
    desc1.putReference(PSString.Null, ref1);
    desc1.putEnumerated(PSString.selectionModifier, PSString.selectionModifierType, PSString.addToSelection);
    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.putEnumerated(PSClass.Layer, PSType.Ordinal, PSEnum.Backward);
    desc1.putReference(PSString.Null, ref1);
    desc1.putEnumerated(PSString.selectionModifier, PSString.selectionModifierType, PSString.addToSelection);
    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.putEnumerated(PSClass.Layer, PSType.Ordinal, PSEnum.Backward);
    desc1.putReference(PSString.Null, ref1);
    desc1.putEnumerated(PSString.selectionModifier, PSString.selectionModifierType, PSString.addToSelection);
    desc1.putBoolean(PSKey.MakeVisible, false);
    executeAction(PSEvent.Select, desc1, dialogMode);
  };

  // Make
  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.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);
    var desc2 = new ActionDescriptor();
    desc2.putString(PSKey.Name, "S3");
    desc1.putObject(PSKey.Using, PSString.layerGroup, desc2);
    executeAction(PSEvent.Make, desc1, dialogMode);
  };

  step1();      // Make
  step2();      // Move
  step3();      // Set
  step4();      // Make
  step5();      // Set
  step6();      // Make
  step7();      // Set
  step8();      // Apply Image
  step9();      // Select
  step10();      // Select
  step11();      // Make
  step12();      // Set
  step13();      // Set
  step14();      // Duplicate
  step15();      // Delete
  step16();      // Set
  step17();      // Select
  step18();      // Set
  step19();      // Make
  step20();      // Set
  step21();      // Set
  step22();      // Delete
  step23();      // Set
  step24();      // Set
  step25();      // Intersect
  step26();      // Make
  step27();      // Set
  step28();      // Set
  step29();      // Set
  step30();      // Subtract
  step31();      // Make
  step32();      // Set
  step33();      // Set
  step34();      // Move
  step35();      // Make
  step36();      // Set
  step37();      // Set
  step38();      // Move
  step39();      // Select
  step40();      // Select
  step41();      // Select
  step42();      // Select
  step43();      // Select
  step44();      // Make
};



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

//
// S3.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.
//
S3.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.ColorBalance = cTID('ClrB');
  PSClass.ColorCorrection = cTID('ClrC');
  PSClass.ColorStop = cTID('Clrt');
  PSClass.Curves = cTID('Crvs');
  PSClass.CurvesAdjustment = cTID('CrvA');
  PSClass.Gradient = cTID('Grdn');
  PSClass.GradientMap = cTID('GdMp');
  PSClass.HSBColor = cTID('HSBC');
  PSClass.LabColor = cTID('LbCl');
  PSClass.Layer = cTID('Lyr ');
  PSClass.Point = cTID('Pnt ');
  PSClass.RGBColor = cTID('RGBC');
  PSClass.SelectiveColor = cTID('SlcC');
  PSClass.TransparencyStop = cTID('TrnS');
  PSEnum.Absolute = cTID('Absl');
  PSEnum.All = cTID('Al  ');
  PSEnum.Backward = cTID('Bckw');
  PSEnum.Blocks = cTID('Blks');
  PSEnum.Blues = cTID('Bls ');
  PSEnum.Composite = cTID('Cmps');
  PSEnum.CustomStops = cTID('CstS');
  PSEnum.Cyans = cTID('Cyns');
  PSEnum.Exclusion = cTID('Xclu');
  PSEnum.Forward = cTID('Frwr');
  PSEnum.Front = cTID('Frnt');
  PSEnum.Greens = cTID('Grns');
  PSEnum.Magentas = cTID('Mgnt');
  PSEnum.Merged = cTID('Mrgd');
  PSEnum.Multiply = cTID('Mltp');
  PSEnum.Neutrals = cTID('Ntrl');
  PSEnum.None = cTID('None');
  PSEnum.Previous = cTID('Prvs');
  PSEnum.RGB = cTID('RGB ');
  PSEnum.Reds = cTID('Rds ');
  PSEnum.Target = cTID('Trgt');
  PSEnum.UserStop = cTID('UsrS');
  PSEnum.Whites = cTID('Whts');
  PSEnum.Yellows = cTID('Ylws');
  PSEvent.Delete = cTID('Dlt ');
  PSEvent.Deselect = cTID('Dslc');
  PSEvent.Duplicate = cTID('Dplc');
  PSEvent.Intersect = cTID('Intr');
  PSEvent.Invert = cTID('Invr');
  PSEvent.Make = cTID('Mk  ');
  PSEvent.Move = cTID('move');
  PSEvent.Select = cTID('slct');
  PSEvent.Set = cTID('setd');
  PSEvent.Subtract = cTID('Sbtr');
  PSKey.Adjustment = cTID('Adjs');
  PSKey.Black = cTID('Blck');
  PSKey.Blue = cTID('Bl  ');
  PSKey.Brightness = cTID('Brgh');
  PSKey.Calculation = cTID('Clcl');
  PSKey.Color = cTID('Clr ');
  PSKey.Colors = cTID('Clrs');
  PSKey.Curve = cTID('Crv ');
  PSKey.Density = cTID('Dnst');
  PSKey.From = cTID('From');
  PSKey.Gradient = cTID('Grad');
  PSKey.Green = cTID('Grn ');
  PSKey.HighlightLevels = cTID('HghL');
  PSKey.Horizontal = cTID('Hrzn');
  PSKey.Hue = cTID('H   ');
  PSKey.Location = cTID('Lctn');
  PSKey.Luminance = cTID('Lmnc');
  PSKey.MakeVisible = cTID('MkVs');
  PSKey.Method = cTID('Mthd');
  PSKey.Midpoint = cTID('Mdpn');
  PSKey.MidtoneLevels = cTID('MdtL');
  PSKey.Mode = cTID('Md  ');
  PSKey.Name = cTID('Nm  ');
  PSKey.Opacity = cTID('Opct');
  PSKey.PreserveLuminosity = cTID('PrsL');
  PSKey.Red = cTID('Rd  ');
  PSKey.ShadowLevels = cTID('ShdL');
  PSKey.Start = cTID('Strt');
  PSKey.To = cTID('T   ');
  PSKey.Transparency = cTID('Trns');
  PSKey.Type = cTID('Type');
  PSKey.Using = cTID('Usng');
  PSKey.Vertical = cTID('Vrtc');
  PSKey.With = cTID('With');
  PSString.Null = sTID('null');
  PSString.a = sTID('a');
  PSString.addToSelection = sTID('addToSelection');
  PSString.b = sTID('b');
  PSString.contentLayer = sTID('contentLayer');
  PSString.layerGroup = sTID('layerSection');
  PSString.photoFilter = sTID('photoFilter');
  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.Calculation = cTID('Clcn');
  PSType.ColorStopType = cTID('Clry');
  PSType.CorrectionMethod = cTID('CrcM');
  PSType.GradientForm = cTID('GrdF');
  PSType.Ordinal = cTID('Ordn');
  PSUnit.Angle = cTID('#Ang');
  PSUnit.Percent = cTID('#Prc');
};

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



//=========================================
//                    S3.main
//=========================================
//

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

S3.main();

// EOF

    },
};


