$._ext_retouch18={
    run : function() {
//
// Generated Wed Apr 15 2015 17:04:52 GMT+0600
//

//
//==================== Black & White ==============
//
function Black_White() {
  // 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.putBoolean(PSKey.Group, true);
    var desc3 = new ActionDescriptor();
    desc3.putEnumerated(PSString.presetKind, PSString.presetKindType, PSString.presetKindDefault);
    desc3.putInteger(PSKey.Red, 40);
    desc3.putInteger(PSEnum.Yellow, 60);
    desc3.putInteger(PSKey.Green, 40);
    desc3.putInteger(PSKey.Cyan, 60);
    desc3.putInteger(PSEnum.Blue, 20);
    desc3.putInteger(PSKey.Magenta, 80);
    desc3.putBoolean(PSString.useTint, false);
    var desc4 = new ActionDescriptor();
    desc4.putDouble(PSKey.Red, 225.000457763672);
    desc4.putDouble(PSKey.Green, 211.000671386719);
    desc4.putDouble(PSEnum.Blue, 179.001159667969);
    desc3.putObject(PSString.tintColor, PSClass.RGBColor, desc4);
    desc2.putObject(PSKey.Type, PSEnum.BlackAndWhite, desc3);
    desc1.putObject(PSKey.Using, PSClass.AdjustmentLayer, desc2);
    executeAction(PSEvent.Make, desc1, dialogMode);
  };

  // Select
  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.Channel, PSClass.Channel, PSEnum.RGB);
    desc1.putReference(PSString.Null, ref1);
    desc1.putBoolean(PSKey.MakeVisible, false);
    executeAction(PSEvent.Select, 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.putString(PSKey.Name, "Black & White");
    desc1.putObject(PSKey.To, PSClass.Layer, desc2);
    executeAction(PSEvent.Set, 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.Layer, PSType.Ordinal, PSEnum.Target);
    desc1.putReference(PSString.Null, ref1);
    var desc2 = new ActionDescriptor();
    desc2.putEnumerated(PSKey.Color, PSKey.Color, PSEnum.Blue);
    desc1.putObject(PSKey.To, PSClass.Layer, desc2);
    executeAction(PSEvent.Set, desc1, dialogMode);
  };

  step1();      // Make
  step2();      // Select
  step3();      // Set
  step4();      // Set
};



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

//
// Black_White.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.
//
Black_White.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.Curves = cTID('Crvs');
  PSClass.HueSaturation = cTID('HStr');
  PSClass.Layer = cTID('Lyr ');
  PSClass.RGBColor = cTID('RGBC');
  PSEnum.BlackAndWhite = cTID('BanW');
  PSEnum.Blue = cTID('Bl  ');
  PSEnum.Hue = cTID('H   ');
  PSEnum.Luminosity = cTID('Lmns');
  PSEnum.RGB = cTID('RGB ');
  PSEnum.Saturation = cTID('Strt');
  PSEnum.Target = cTID('Trgt');
  PSEnum.Yellow = cTID('Yllw');
  PSEvent.Hide = cTID('Hd  ');
  PSEvent.Make = cTID('Mk  ');
  PSEvent.Rasterize = cTID('Rstr');
  PSEvent.Select = cTID('slct');
  PSEvent.Set = cTID('setd');
  PSKey.Color = cTID('Clr ');
  PSKey.Colorize = cTID('Clrz');
  PSKey.Cyan = cTID('Cyn ');
  PSKey.Green = cTID('Grn ');
  PSKey.Group = cTID('Grup');
  PSKey.Magenta = cTID('Mgnt');
  PSKey.MakeVisible = cTID('MkVs');
  PSKey.Mode = cTID('Md  ');
  PSKey.Name = cTID('Nm  ');
  PSKey.Red = cTID('Rd  ');
  PSKey.To = cTID('T   ');
  PSKey.Type = cTID('Type');
  PSKey.Using = cTID('Usng');
  PSString.Null = sTID('null');
  PSString.contentLayer = sTID('contentLayer');
  PSString.presetKind = sTID('presetKind');
  PSString.presetKindDefault = sTID('presetKindDefault');
  PSString.presetKindType = sTID('presetKindType');
  PSString.solidColorLayer = sTID('solidColorLayer');
  PSString.tintColor = sTID('tintColor');
  PSString.useTint = sTID('useTint');
  PSType.BlendMode = cTID('BlnM');
  PSType.Ordinal = cTID('Ordn');
};

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



//=========================================
//                    Black_White.main
//=========================================
//

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

Black_White.main();

// EOF
    },
};
