//
// Generated Mon Sep 07 2015 12:32:06 GMT+0600
//

//
//==================== Points Curve 4 ==============
//
function PointsCurve4() {
  // 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();
    var desc3 = new ActionDescriptor();
    desc3.putEnumerated(PSString.presetKind, PSString.presetKindType, PSString.presetKindDefault);
    desc2.putObject(PSKey.Type, PSEvent.Curves, 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.Layer, PSType.Ordinal, PSEnum.Target);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    desc2.putEnumerated(PSKey.Mode, PSType.BlendMode, PSEnum.Luminosity);
    desc1.putObject(PSKey.To, PSClass.Layer, desc2);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

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

  // Select
  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.Channel, PSClass.Channel, PSEnum.RGB);
    desc1.putReference(PSString.Null, ref1);
    desc1.putBoolean(PSKey.MakeVisible, false);
    executeAction(PSEvent.Select, 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.putString(PSKey.Name, "Point_Curve");
    desc1.putObject(PSKey.To, PSClass.Layer, 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.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, 51);
    desc5.putDouble(PSKey.Vertical, 51);
    list2.putObject(PSClass.Point, desc5);
    var desc6 = new ActionDescriptor();
    desc6.putDouble(PSKey.Horizontal, 102);
    desc6.putDouble(PSKey.Vertical, 102);
    list2.putObject(PSClass.Point, desc6);
    var desc7 = new ActionDescriptor();
    desc7.putDouble(PSKey.Horizontal, 153);
    desc7.putDouble(PSKey.Vertical, 153);
    list2.putObject(PSClass.Point, desc7);
    var desc8 = new ActionDescriptor();
    desc8.putDouble(PSKey.Horizontal, 204);
    desc8.putDouble(PSKey.Vertical, 204);
    list2.putObject(PSClass.Point, desc8);
    var desc9 = new ActionDescriptor();
    desc9.putDouble(PSKey.Horizontal, 255);
    desc9.putDouble(PSKey.Vertical, 255);
    list2.putObject(PSClass.Point, desc9);
    desc3.putList(PSKey.Curve, list2);
    list1.putObject(PSClass.CurvesAdjustment, desc3);
    desc2.putList(PSKey.Adjustment, list1);
    desc1.putObject(PSKey.To, PSEvent.Curves, desc2);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

  // Set
  function step7(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var desc1 = new ActionDescriptor();
    var ref1 = new ActionReference();
    ref1.putEnumerated(PSClass.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, PSKey.Red);
    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, 51);
    desc5.putDouble(PSKey.Vertical, 51);
    list2.putObject(PSClass.Point, desc5);
    var desc6 = new ActionDescriptor();
    desc6.putDouble(PSKey.Horizontal, 102);
    desc6.putDouble(PSKey.Vertical, 102);
    list2.putObject(PSClass.Point, desc6);
    var desc7 = new ActionDescriptor();
    desc7.putDouble(PSKey.Horizontal, 153);
    desc7.putDouble(PSKey.Vertical, 153);
    list2.putObject(PSClass.Point, desc7);
    var desc8 = new ActionDescriptor();
    desc8.putDouble(PSKey.Horizontal, 204);
    desc8.putDouble(PSKey.Vertical, 204);
    list2.putObject(PSClass.Point, desc8);
    var desc9 = new ActionDescriptor();
    desc9.putDouble(PSKey.Horizontal, 255);
    desc9.putDouble(PSKey.Vertical, 255);
    list2.putObject(PSClass.Point, desc9);
    desc3.putList(PSKey.Curve, list2);
    list1.putObject(PSClass.CurvesAdjustment, desc3);
    var desc10 = new ActionDescriptor();
    var ref3 = new ActionReference();
    ref3.putEnumerated(PSClass.Channel, PSClass.Channel, PSKey.Green);
    desc10.putReference(PSClass.Channel, ref3);
    var list3 = new ActionList();
    var desc11 = new ActionDescriptor();
    desc11.putDouble(PSKey.Horizontal, 0);
    desc11.putDouble(PSKey.Vertical, 0);
    list3.putObject(PSClass.Point, desc11);
    var desc12 = new ActionDescriptor();
    desc12.putDouble(PSKey.Horizontal, 51);
    desc12.putDouble(PSKey.Vertical, 51);
    list3.putObject(PSClass.Point, desc12);
    var desc13 = new ActionDescriptor();
    desc13.putDouble(PSKey.Horizontal, 102);
    desc13.putDouble(PSKey.Vertical, 102);
    list3.putObject(PSClass.Point, desc13);
    var desc14 = new ActionDescriptor();
    desc14.putDouble(PSKey.Horizontal, 153);
    desc14.putDouble(PSKey.Vertical, 153);
    list3.putObject(PSClass.Point, desc14);
    var desc15 = new ActionDescriptor();
    desc15.putDouble(PSKey.Horizontal, 204);
    desc15.putDouble(PSKey.Vertical, 204);
    list3.putObject(PSClass.Point, desc15);
    var desc16 = new ActionDescriptor();
    desc16.putDouble(PSKey.Horizontal, 255);
    desc16.putDouble(PSKey.Vertical, 255);
    list3.putObject(PSClass.Point, desc16);
    desc10.putList(PSKey.Curve, list3);
    list1.putObject(PSClass.CurvesAdjustment, desc10);
    var desc17 = new ActionDescriptor();
    var ref4 = new ActionReference();
    ref4.putEnumerated(PSClass.Channel, PSClass.Channel, PSKey.Blue);
    desc17.putReference(PSClass.Channel, ref4);
    var list4 = new ActionList();
    var desc18 = new ActionDescriptor();
    desc18.putDouble(PSKey.Horizontal, 0);
    desc18.putDouble(PSKey.Vertical, 0);
    list4.putObject(PSClass.Point, desc18);
    var desc19 = new ActionDescriptor();
    desc19.putDouble(PSKey.Horizontal, 51);
    desc19.putDouble(PSKey.Vertical, 51);
    list4.putObject(PSClass.Point, desc19);
    var desc20 = new ActionDescriptor();
    desc20.putDouble(PSKey.Horizontal, 102);
    desc20.putDouble(PSKey.Vertical, 102);
    list4.putObject(PSClass.Point, desc20);
    var desc21 = new ActionDescriptor();
    desc21.putDouble(PSKey.Horizontal, 153);
    desc21.putDouble(PSKey.Vertical, 153);
    list4.putObject(PSClass.Point, desc21);
    var desc22 = new ActionDescriptor();
    desc22.putDouble(PSKey.Horizontal, 204);
    desc22.putDouble(PSKey.Vertical, 204);
    list4.putObject(PSClass.Point, desc22);
    var desc23 = new ActionDescriptor();
    desc23.putDouble(PSKey.Horizontal, 255);
    desc23.putDouble(PSKey.Vertical, 255);
    list4.putObject(PSClass.Point, desc23);
    desc17.putList(PSKey.Curve, list4);
    list1.putObject(PSClass.CurvesAdjustment, desc17);
    desc2.putList(PSKey.Adjustment, list1);
    desc1.putObject(PSKey.To, PSEvent.Curves, 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.putString(PSKey.Name, "4 Points_Curve");
    desc1.putObject(PSKey.To, PSClass.Layer, desc2);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

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



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

//
// PointsCurve4.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.
//
PointsCurve4.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.CurvesAdjustment = cTID('CrvA');
  PSClass.Document = cTID('Dcmn');
  PSClass.Invert = cTID('Invr');
  PSClass.Layer = cTID('Lyr ');
  PSClass.Mask = cTID('Msk ');
  PSClass.PaintbrushTool = cTID('PbTl');
  PSClass.Point = cTID('Pnt ');
  PSClass.RGBColor = cTID('RGBC');
  PSEnum.Backward = cTID('Bckw');
  PSEnum.Black = cTID('Blck');
  PSEnum.BlackAndWhite = cTID('BanW');
  PSEnum.Composite = cTID('Cmps');
  PSEnum.First = cTID('Frst');
  PSEnum.Forward = cTID('Frwr');
  PSEnum.Front = cTID('Frnt');
  PSEnum.HideAll = cTID('HdAl');
  PSEnum.Image = cTID('Img ');
  PSEnum.Luminosity = cTID('Lmns');
  PSEnum.Merged = cTID('Mrgd');
  PSEnum.Multiply = cTID('Mltp');
  PSEnum.No = cTID('N   ');
  PSEnum.Overlay = cTID('Ovrl');
  PSEnum.RGB = cTID('RGB ');
  PSEnum.RevealAll = cTID('RvlA');
  PSEnum.Screen = cTID('Scrn');
  PSEnum.Target = cTID('Trgt');
  PSEnum.Yellow = cTID('Yllw');
  PSEvent.Close = cTID('Cls ');
  PSEvent.Curves = cTID('Crvs');
  PSEvent.Delete = cTID('Dlt ');
  PSEvent.Duplicate = cTID('Dplc');
  PSEvent.Hide = cTID('Hd  ');
  PSEvent.Make = cTID('Mk  ');
  PSEvent.Move = cTID('move');
  PSEvent.Select = cTID('slct');
  PSEvent.Set = cTID('setd');
  PSKey.Adjustment = cTID('Adjs');
  PSKey.At = cTID('At  ');
  PSKey.Blue = cTID('Bl  ');
  PSKey.Color = cTID('Clr ');
  PSKey.Curve = cTID('Crv ');
  PSKey.Cyan = cTID('Cyn ');
  PSKey.Dither = cTID('Dthr');
  PSKey.From = cTID('From');
  PSKey.Green = cTID('Grn ');
  PSKey.Group = cTID('Grup');
  PSKey.Horizontal = cTID('Hrzn');
  PSKey.Intent = cTID('Inte');
  PSKey.Magenta = cTID('Mgnt');
  PSKey.MakeVisible = cTID('MkVs');
  PSKey.MapBlack = cTID('MpBl');
  PSKey.Mode = cTID('Md  ');
  PSKey.Name = cTID('Nm  ');
  PSKey.New = cTID('Nw  ');
  PSKey.Opacity = cTID('Opct');
  PSKey.PreserveTransparency = cTID('PrsT');
  PSKey.Radius = cTID('Rds ');
  PSKey.Red = cTID('Rd  ');
  PSKey.Saving = cTID('Svng');
  PSKey.ShadowMode = cTID('sdwM');
  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.addToSelectionContinuous = sTID('addToSelectionContinuous');
  PSString.layerGroup = sTID('layerSection');
  PSString.presetKind = sTID('presetKind');
  PSString.presetKindCustom = sTID('presetKindCustom');
  PSString.presetKindDefault = sTID('presetKindDefault');
  PSString.presetKindFactory = sTID('presetKindFactory');
  PSString.presetKindType = sTID('presetKindType');
  PSString.selectionModifier = sTID('selectionModifier');
  PSString.selectionModifierType = sTID('selectionModifierType');
  PSString.tintColor = sTID('tintColor');
  PSString.useTint = sTID('useTint');
  PSType.BlendMode = cTID('BlnM');
  PSType.Ordinal = cTID('Ordn');
  PSType.UserMaskOptions = cTID('UsrM');
  PSType.YesNo = cTID('YsN ');
  PSUnit.Percent = cTID('#Prc');
  PSUnit.Pixels = cTID('#Pxl');
};

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



//=========================================
//                    PointsCurve4.main
//=========================================
//

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

PointsCurve4.main();

// EOF
