/*

-- The 2nd and 3rd "Caption & Borders" buttons need to be refined to operate like the original actions...right now, we get odd results that don't look the same.


*/

$._ext_PHXS={

debug : false,
dialogMode : DialogModes.NO,
	/*
var blackColor = new SolidColor();
blackColor.rgb.hexValue = "000000";

var whiteColor = new SolidColor();
whiteColor.rgb.hexValue = "FFFFFF";

*/
log : function(msg)
{
if (!debug) return; 
try{
$.writeln(msg+" - "+msg.toSource());    
}catch(e){}
},




Dodge : function()
		{
	var idslct = charIDToTypeID( 'slct' );
    var desc109 = new ActionDescriptor();
	var idnull = charIDToTypeID( 'null' );
	var ref109 = new ActionReference();
	var idDdTl = charIDToTypeID( 'DdTl' );
	ref109.putClass( idDdTl );     
	desc109.putReference( idnull, ref109 ); 
	executeAction( idslct, desc109, DialogModes.ALL );
},


Burn : function()
		{
	var idslct = charIDToTypeID( "slct" );
    var desc7 = new ActionDescriptor();
    var idnull = charIDToTypeID( "null" );
    var ref5 = new ActionReference();
    var idBrTl = charIDToTypeID( "BrTl" );
    ref5.putClass( idBrTl );
    desc7.putReference( idnull, ref5 );
	executeAction( idslct, desc7, DialogModes.NO );
},





setLayerBlue : function()
{
         var desc1 = new ActionDescriptor();
    var ref1 = new ActionReference();
    ref1.putEnumerated(app.charIDToTypeID('Lyr '), app.charIDToTypeID('Ordn'), app.charIDToTypeID('Trgt'));
    desc1.putReference(app.charIDToTypeID('null'), ref1);
    var desc2 = new ActionDescriptor();
    desc2.putEnumerated(app.charIDToTypeID('Clr '), app.charIDToTypeID('Clr '), app.charIDToTypeID('Bl  '));
    desc1.putObject(app.charIDToTypeID('T   '), app.charIDToTypeID('Lyr '), desc2);
    executeAction(app.charIDToTypeID('setd'), desc1, DialogModes.NO);  
},

setLayerOrange: function()
{
             var desc1 = new ActionDescriptor();
    var ref1 = new ActionReference();
    ref1.putEnumerated(app.charIDToTypeID('Lyr '), app.charIDToTypeID('Ordn'), app.charIDToTypeID('Trgt'));
    desc1.putReference(app.charIDToTypeID('null'), ref1);
    var desc2 = new ActionDescriptor();
    desc2.putEnumerated(app.charIDToTypeID('Clr '), app.charIDToTypeID('Clr '), app.charIDToTypeID('Orng'));
    desc1.putObject(app.charIDToTypeID('T   '), app.charIDToTypeID('Lyr '), desc2);
    executeAction(app.charIDToTypeID('setd'), desc1, DialogModes.NO);  
},

setLayerYellow: function()
{
             var desc1 = new ActionDescriptor();
    var ref1 = new ActionReference();
    ref1.putEnumerated(app.charIDToTypeID('Lyr '), app.charIDToTypeID('Ordn'), app.charIDToTypeID('Trgt'));
    desc1.putReference(app.charIDToTypeID('null'), ref1);
    var desc2 = new ActionDescriptor();
    desc2.putEnumerated(app.charIDToTypeID('Clr '), app.charIDToTypeID('Clr '), app.charIDToTypeID('Ylw '));
    desc1.putObject(app.charIDToTypeID('T   '), app.charIDToTypeID('Lyr '), desc2);
    executeAction(app.charIDToTypeID('setd'), desc1, DialogModes.NO);  
},

setLayerGreen: function()
{
             var desc1 = new ActionDescriptor();
    var ref1 = new ActionReference();
    ref1.putEnumerated(app.charIDToTypeID('Lyr '), app.charIDToTypeID('Ordn'), app.charIDToTypeID('Trgt'));
    desc1.putReference(app.charIDToTypeID('null'), ref1);
    var desc2 = new ActionDescriptor();
    desc2.putEnumerated(app.charIDToTypeID('Clr '), app.charIDToTypeID('Clr '), app.charIDToTypeID('Grn '));
    desc1.putObject(app.charIDToTypeID('T   '), app.charIDToTypeID('Lyr '), desc2);
    executeAction(app.charIDToTypeID('setd'), desc1, DialogModes.NO);  
},

setLayerRed: function()
{
             var desc1 = new ActionDescriptor();
    var ref1 = new ActionReference();
    ref1.putEnumerated(app.charIDToTypeID('Lyr '), app.charIDToTypeID('Ordn'), app.charIDToTypeID('Trgt'));
    desc1.putReference(app.charIDToTypeID('null'), ref1);
    var desc2 = new ActionDescriptor();
    desc2.putEnumerated(app.charIDToTypeID('Clr '), app.charIDToTypeID('Clr '), app.charIDToTypeID('Rd  '));
    desc1.putObject(app.charIDToTypeID('T   '), app.charIDToTypeID('Lyr '), desc2);
    executeAction(app.charIDToTypeID('setd'), desc1, DialogModes.NO);  
},




centerLayerToDoc: function(layerRef,docRef)
{
  
       layerRef.translate(docRef.width/2-layerRef.bounds[0]/2-layerRef.bounds[2]/2,docRef.height/2-layerRef.bounds[1]/2-layerRef.bounds[3]/2);
    
},
//

createShapeWithText : function(shapeName,textContents,shapeLayerName,height,width,centerPosition)
{
app.displayDialogs = DialogModes.NO;
app.preferences.rulerUnits=Units.PIXELS;

    var shapeLayer;
    var textLayer;
    var newSet;
    var blackColor = new SolidColor();
blackColor.rgb.hexValue = "000000";

var whiteColor = new SolidColor();
whiteColor.rgb.hexValue = "FFFFFF";

var dialogMode = DialogModes.NO;
        try{
        if(!app.documents.length) return;
         var docRef = app.activeDocument;
         
           var desc1 = new ActionDescriptor();
    var ref1 = new ActionReference();
    ref1.putClass(app.stringIDToTypeID("contentLayer"));
    desc1.putReference(app.charIDToTypeID('null'), ref1);
    var desc2 = new ActionDescriptor();
    var desc3 = new ActionDescriptor();
    var desc4 = new ActionDescriptor();
    desc4.putDouble(app.charIDToTypeID('Rd  '), 255);
    desc4.putDouble(app.charIDToTypeID('Grn '), 255);
    desc4.putDouble(app.charIDToTypeID('Bl  '), 255);
    desc3.putObject(app.charIDToTypeID('Clr '), app.stringIDToTypeID("RGBColor"), desc4);
    desc2.putObject(app.charIDToTypeID('Type'), app.stringIDToTypeID("solidColorLayer"), desc3);
    var desc5 = new ActionDescriptor();
    desc5.putString(app.charIDToTypeID('Nm  '), shapeName);
    desc5.putUnitDouble(app.charIDToTypeID('Top '), app.charIDToTypeID('#Pxl'), 0);
    desc5.putUnitDouble(app.charIDToTypeID('Left'), app.charIDToTypeID('#Pxl'), 0);
    desc5.putUnitDouble(app.charIDToTypeID('Btom'), app.charIDToTypeID('#Pxl'), height);
    desc5.putUnitDouble(app.charIDToTypeID('Rght'), app.charIDToTypeID('#Pxl'), width);
    desc2.putObject(app.charIDToTypeID('Shp '), app.stringIDToTypeID("customShape"), desc5);
    desc1.putObject(app.charIDToTypeID('Usng'), app.stringIDToTypeID("contentLayer"), desc2);
    executeAction(app.charIDToTypeID('Mk  '), desc1, dialogMode);
    
    
    //set style
    var idsetd = charIDToTypeID( "setd" );
    var desc20 = new ActionDescriptor();
    var idnull = charIDToTypeID( "null" );
        var ref15 = new ActionReference();
        var idPrpr = charIDToTypeID( "Prpr" );
        var idLefx = charIDToTypeID( "Lefx" );
        ref15.putProperty( idPrpr, idLefx );
        var idLyr = charIDToTypeID( "Lyr " );
        var idOrdn = charIDToTypeID( "Ordn" );
        var idTrgt = charIDToTypeID( "Trgt" );
        ref15.putEnumerated( idLyr, idOrdn, idTrgt );
    desc20.putReference( idnull, ref15 );
    var idT = charIDToTypeID( "T   " );
        var desc21 = new ActionDescriptor();
        var idScl = charIDToTypeID( "Scl " );
        var idPrc = charIDToTypeID( "#Prc" );
        desc21.putUnitDouble( idScl, idPrc, docRef.resolution/72 );
     
        var idFrFX = charIDToTypeID( "FrFX" );
            var desc29 = new ActionDescriptor();
            var idenab = charIDToTypeID( "enab" );
            desc29.putBoolean( idenab, true );
            var idStyl = charIDToTypeID( "Styl" );
            var idFStl = charIDToTypeID( "FStl" );
            var idOutF = charIDToTypeID( "OutF" );
            desc29.putEnumerated( idStyl, idFStl, idOutF );
            var idPntT = charIDToTypeID( "PntT" );
            var idFrFl = charIDToTypeID( "FrFl" );
            var idSClr = charIDToTypeID( "SClr" );
            desc29.putEnumerated( idPntT, idFrFl, idSClr );
            var idMd = charIDToTypeID( "Md  " );
            var idBlnM = charIDToTypeID( "BlnM" );
            var idNrml = charIDToTypeID( "Nrml" );
            desc29.putEnumerated( idMd, idBlnM, idNrml );
            var idOpct = charIDToTypeID( "Opct" );
            var idPrc = charIDToTypeID( "#Prc" );
            desc29.putUnitDouble( idOpct, idPrc, 100.000000 );
            var idSz = charIDToTypeID( "Sz  " );
            var idPxl = charIDToTypeID( "#Pxl" );
            desc29.putUnitDouble( idSz, idPxl, 6.000000 );
            var idClr = charIDToTypeID( "Clr " );
                var desc30 = new ActionDescriptor();
                var idRd = charIDToTypeID( "Rd  " );
                desc30.putDouble( idRd, 0.254910 );
                var idGrn = charIDToTypeID( "Grn " );
                desc30.putDouble( idGrn, 0.491516 );
                var idBl = charIDToTypeID( "Bl  " );
                desc30.putDouble( idBl, 0.502616 );
            var idRGBC = charIDToTypeID( "RGBC" );
            desc29.putObject( idClr, idRGBC, desc30 );
        var idFrFX = charIDToTypeID( "FrFX" );
        desc21.putObject( idFrFX, idFrFX, desc29 );
    var idLefx = charIDToTypeID( "Lefx" );
    desc20.putObject( idT, idLefx, desc21 );
executeAction( idsetd, desc20, DialogModes.NO );
    
    //make blue
    //setLayerBlue();
    
    //align centers of layer and doc
    var shapeLayer = docRef.activeLayer;
    shapeLayer.name = shapeLayerName;
    this.centerLayerToDoc(shapeLayer,docRef);

      var textLayer = docRef.artLayers.add();
      
       textLayer.move(shapeLayer,ElementPlacement.PLACEBEFORE);  
        textLayer.kind = LayerKind.TEXT;
             
            var myText = textLayer.textItem;


       
             
            myText.antiAliasMethod=AntiAlias.CRISP;
            myText.kind = TextType.PARAGRAPHTEXT;
            
                          myText.contents = textContents;
                          this.applySizeToChar (myText.contents.length, 65 / docRef.resolution * 72);
                          
            myText.justification = Justification.LEFT;
           
             textLayer.textItem.height = (shapeLayer.bounds[3] - shapeLayer.bounds[1]) / docRef.resolution * 72;
     textLayer.textItem.width = (shapeLayer.bounds[2] - shapeLayer.bounds[0]) / docRef.resolution * 72;
     textLayer.textItem.position = [shapeLayer.bounds[0],shapeLayer.bounds[1]];
       
           
            
            myText.hyphenation = false;
            
          
              
            
            myText.color = blackColor;
           
            
            myText.font = "ComicSansMS";
            myText.justification = Justification.CENTER;
            
   myText.height = (textLayer.bounds[3]-textLayer.bounds[1]) / docRef.resolution * 72;
        
      textLayer.translate(0,shapeLayer.bounds[1]+(shapeLayer.bounds[3]-shapeLayer.bounds[1])/2.9-textLayer.bounds[1]-
      													(textLayer.bounds[3]-textLayer.bounds[1])/2);
      //setLayerBlue();
              
    //create group out of these layers
   var newSet = textLayer.parent.layerSets.add();
   newSet.name = shapeLayerName;
   this.setLayerBlue();
        
         shapeLayer.move(newSet,ElementPlacement.INSIDE);
          textLayer.move(newSet,ElementPlacement.INSIDE);
         
     docRef.activeLayer = shapeLayer;
     
     
         }catch(e){alert(e);}
     },

colorAdjuster: function()
{
   
    try{
     this.createHSLlayer(0,0,0);
    
    
    }catch(e){}
  },


brightnessAdjuster: function()
{
   
    try{
var idMk = charIDToTypeID( "Mk  " );
    var desc3 = new ActionDescriptor();
    var idnull = charIDToTypeID( "null" );
        var ref1 = new ActionReference();
        var idAdjL = charIDToTypeID( "AdjL" );
        ref1.putClass( idAdjL );
    desc3.putReference( idnull, ref1 );
    var idUsng = charIDToTypeID( "Usng" );
        var desc4 = new ActionDescriptor();
                var idNm = charIDToTypeID( "Nm  " );
        desc4.putString( idNm, "Light Adjust" );

        var idGrup = charIDToTypeID( "Grup" );
        desc4.putBoolean( idGrup, true );
        
        
        var idType = charIDToTypeID( "Type" );
            var desc5 = new ActionDescriptor();
            var iduseLegacy = stringIDToTypeID( "useLegacy" );
            desc5.putBoolean( iduseLegacy, false );
        var idBrgC = charIDToTypeID( "BrgC" );
        desc4.putObject( idType, idBrgC, desc5 );
    var idAdjL = charIDToTypeID( "AdjL" );
    desc3.putObject( idUsng, idAdjL, desc4 );

executeAction( idMk, desc3, DialogModes.NO);



var desc10 = new ActionDescriptor();
var ref4 = new ActionReference();
ref4.putEnumerated( charIDToTypeID('AdjL'), charIDToTypeID('Ordn'), charIDToTypeID('Trgt') );
desc10.putReference( charIDToTypeID('null'), ref4 );
    var desc25 = new ActionDescriptor();
    var idBrgh = charIDToTypeID( "Brgh" );
    desc25.putInteger( idBrgh, 0 );
    var idCntr = charIDToTypeID( "Cntr" );
    desc25.putInteger( idCntr, 0 );  
desc10.putObject( charIDToTypeID('T   '), charIDToTypeID('BrgC'), desc25 );
executeAction( charIDToTypeID('setd'), desc10, DialogModes.ALL );
    
    }catch(e){}
  },

    run : function(func) {
    
    var blackColor = new SolidColor();
blackColor.rgb.hexValue = "000000";

var whiteColor = new SolidColor();
whiteColor.rgb.hexValue = "FFFFFF";

var dialogMode = DialogModes.NO;

    	try{
    	switch(func)
    	{
    	
    	case "splashCaption":
        if(!app.documents.length) return;
        /*
    	this.performFunction("Splash Caption",'this.createShapeWithText("Boom 1","BOOOM!","Splash Caption",778-207,965-199);');
        //shapeName,textContents,shapeLayerName,height,width,centerPosition
        */
        var shapeName = "Boom 1";
        var textContent = "BOOOM!";
        var shapeLayerName = "Splash Caption";
        var width = 778-207;
        var height = 965-199;
        
        
        app.displayDialogs = DialogModes.NO;
app.preferences.rulerUnits=Units.PIXELS;

    var shapeLayer;
    var textLayer;
    var newSet;
    var blackColor = new SolidColor();
blackColor.rgb.hexValue = "000000";

var whiteColor = new SolidColor();
whiteColor.rgb.hexValue = "FFFFFF";

var dialogMode = DialogModes.NO;
        
        
         var docRef = app.activeDocument;
         
           var desc1 = new ActionDescriptor();
    var ref1 = new ActionReference();
    ref1.putClass(app.stringIDToTypeID("contentLayer"));
    desc1.putReference(app.charIDToTypeID('null'), ref1);
    var desc2 = new ActionDescriptor();
    var desc3 = new ActionDescriptor();
    var desc4 = new ActionDescriptor();
    desc4.putDouble(app.charIDToTypeID('Rd  '), 0);
    desc4.putDouble(app.charIDToTypeID('Grn '), 0);
    desc4.putDouble(app.charIDToTypeID('Bl  '), 0);
    desc3.putObject(app.charIDToTypeID('Clr '), app.stringIDToTypeID("RGBColor"), desc4);
    desc2.putObject(app.charIDToTypeID('Type'), app.stringIDToTypeID("solidColorLayer"), desc3);
    var desc5 = new ActionDescriptor();
    desc5.putString(app.charIDToTypeID('Nm  '), shapeName);
    desc5.putUnitDouble(app.charIDToTypeID('Top '), app.charIDToTypeID('#Pxl'), 0);
    desc5.putUnitDouble(app.charIDToTypeID('Left'), app.charIDToTypeID('#Pxl'), 0);
    desc5.putUnitDouble(app.charIDToTypeID('Btom'), app.charIDToTypeID('#Pxl'), height);
    desc5.putUnitDouble(app.charIDToTypeID('Rght'), app.charIDToTypeID('#Pxl'), width);
    desc2.putObject(app.charIDToTypeID('Shp '), app.stringIDToTypeID("customShape"), desc5);
    desc1.putObject(app.charIDToTypeID('Usng'), app.stringIDToTypeID("contentLayer"), desc2);
    executeAction(app.charIDToTypeID('Mk  '), desc1, dialogMode);
    
    var bottomShapeLayer = docRef.activeLayer;
    bottomShapeLayer.rotate(90);
    var topShapeLayer  = bottomShapeLayer.duplicate();
    docRef.activeLayer = topShapeLayer;
    
    var idsetd = charIDToTypeID( "setd" );
    var desc43 = new ActionDescriptor();
    var idnull = charIDToTypeID( "null" );
        var ref40 = new ActionReference();
        var idcontentLayer = stringIDToTypeID( "contentLayer" );
        var idOrdn = charIDToTypeID( "Ordn" );
        var idTrgt = charIDToTypeID( "Trgt" );
        ref40.putEnumerated( idcontentLayer, idOrdn, idTrgt );
    desc43.putReference( idnull, ref40 );
    var idT = charIDToTypeID( "T   " );
        var desc44 = new ActionDescriptor();
        var idClr = charIDToTypeID( "Clr " );
            var desc45 = new ActionDescriptor();
            var idRd = charIDToTypeID( "Rd  " );
            desc45.putDouble( idRd, 255.000000 );
            var idGrn = charIDToTypeID( "Grn " );
            desc45.putDouble( idGrn, 0.00 );
            var idBl = charIDToTypeID( "Bl  " );
            desc45.putDouble( idBl, 0.00 );
        var idRGBC = charIDToTypeID( "RGBC" );
        desc44.putObject( idClr, idRGBC, desc45 );
    var idsolidColorLayer = stringIDToTypeID( "solidColorLayer" );
    desc43.putObject( idT, idsolidColorLayer, desc44 );
executeAction( idsetd, desc43, DialogModes.NO );

 var desc1 = new ActionDescriptor();
    var ref1 = new ActionReference();
    ref1.putProperty(app.charIDToTypeID('Prpr'), app.charIDToTypeID('Lefx'));
    ref1.putEnumerated(app.charIDToTypeID('Lyr '), app.charIDToTypeID('Ordn'), app.charIDToTypeID('Trgt'));
    desc1.putReference(app.charIDToTypeID('null'), ref1);
    var desc2 = new ActionDescriptor();
    desc2.putUnitDouble(app.charIDToTypeID('Scl '), app.charIDToTypeID('#Prc'), docRef.resolution/72);
    var desc3 = new ActionDescriptor();
    desc3.putBoolean(app.charIDToTypeID('enab'), true);
    desc3.putEnumerated(app.charIDToTypeID('Md  '), app.charIDToTypeID('BlnM'), app.charIDToTypeID('Scrn'));
    var desc4 = new ActionDescriptor();
    desc4.putDouble(app.charIDToTypeID('Rd  '), 255);
    desc4.putDouble(app.charIDToTypeID('Grn '), 221.996612548828);
    desc4.putDouble(app.charIDToTypeID('Bl  '), 0);
    desc3.putObject(app.charIDToTypeID('Clr '), app.stringIDToTypeID("RGBColor"), desc4);
    desc3.putUnitDouble(app.charIDToTypeID('Opct'), app.charIDToTypeID('#Prc'), 100);
    desc3.putEnumerated(app.charIDToTypeID('GlwT'), app.charIDToTypeID('BETE'), app.charIDToTypeID('SfBL'));
    desc3.putUnitDouble(app.charIDToTypeID('Ckmt'), app.charIDToTypeID('#Pxl'), 0);
    desc3.putUnitDouble(app.charIDToTypeID('blur'), app.charIDToTypeID('#Pxl'), 32);
    desc3.putUnitDouble(app.charIDToTypeID('ShdN'), app.charIDToTypeID('#Prc'), 0);
    desc3.putUnitDouble(app.charIDToTypeID('Nose'), app.charIDToTypeID('#Prc'), 0);
    desc3.putBoolean(app.charIDToTypeID('AntA'), false);
    desc3.putEnumerated(app.charIDToTypeID('glwS'), app.charIDToTypeID('IGSr'), app.charIDToTypeID('SrcE'));
    var desc5 = new ActionDescriptor();
    desc5.putString(app.charIDToTypeID('Nm  '), "$$$/Contours/Defaults/Linear=Linear");
    desc3.putObject(app.charIDToTypeID('TrnS'), app.charIDToTypeID('ShpC'), desc5);
    desc3.putUnitDouble(app.charIDToTypeID('Inpr'), app.charIDToTypeID('#Prc'), 50);
    desc2.putObject(app.charIDToTypeID('IrGl'), app.charIDToTypeID('IrGl'), desc3);
    var desc6 = new ActionDescriptor();
    desc6.putBoolean(app.charIDToTypeID('enab'), true);
    desc6.putEnumerated(app.charIDToTypeID('Styl'), app.charIDToTypeID('FStl'), app.charIDToTypeID('OutF'));
    desc6.putEnumerated(app.charIDToTypeID('PntT'), app.charIDToTypeID('FrFl'), app.charIDToTypeID('SClr'));
    desc6.putEnumerated(app.charIDToTypeID('Md  '), app.charIDToTypeID('BlnM'), app.charIDToTypeID('Nrml'));
    desc6.putUnitDouble(app.charIDToTypeID('Opct'), app.charIDToTypeID('#Prc'), 100);
    desc6.putUnitDouble(app.charIDToTypeID('Sz  '), app.charIDToTypeID('#Pxl'), 8);
    var desc7 = new ActionDescriptor();
    desc7.putDouble(app.charIDToTypeID('Rd  '), 0.25491042004433);
    desc7.putDouble(app.charIDToTypeID('Grn '), 0.49151558952872);
    desc7.putDouble(app.charIDToTypeID('Bl  '), 0.50261559546925);
    desc6.putObject(app.charIDToTypeID('Clr '), app.stringIDToTypeID("RGBColor"), desc7);
    desc2.putObject(app.charIDToTypeID('FrFX'), app.charIDToTypeID('FrFX'), desc6);
    desc1.putObject(app.charIDToTypeID('T   '), app.charIDToTypeID('Lefx'), desc2);
    executeAction(app.charIDToTypeID('setd'), desc1, dialogMode);
    
    topShapeLayer.rotate(-2.5);
    
    //create text layer
    var desc1 = new ActionDescriptor();
    var ref1 = new ActionReference();
    ref1.putClass(app.charIDToTypeID('TxLr'));
    desc1.putReference(app.charIDToTypeID('null'), ref1);
    var desc2 = new ActionDescriptor();
    desc2.putString(app.charIDToTypeID('Txt '), "BOOM!");
    var desc3 = new ActionDescriptor();
    desc3.putEnumerated(app.stringIDToTypeID("warpStyle"), app.stringIDToTypeID("warpStyle"), app.stringIDToTypeID("warpNone"));
    desc3.putDouble(app.stringIDToTypeID("warpValue"), 0);
    desc3.putDouble(app.stringIDToTypeID("warpPerspective"), 0);
    desc3.putDouble(app.stringIDToTypeID("warpPerspectiveOther"), 0);
    desc3.putEnumerated(app.stringIDToTypeID("warpRotate"), app.charIDToTypeID('Ornt'), app.charIDToTypeID('Hrzn'));
    desc2.putObject(app.charIDToTypeID('warp'), app.charIDToTypeID('warp'), desc3);
    var desc4 = new ActionDescriptor();
    desc4.putUnitDouble(app.charIDToTypeID('Hrzn'), app.charIDToTypeID('#Prc'), 8.47018150388937);
    desc4.putUnitDouble(app.charIDToTypeID('Vrtc'), app.charIDToTypeID('#Prc'), 13.7305699481865);
    desc2.putObject(app.charIDToTypeID('TxtC'), app.charIDToTypeID('Pnt '), desc4);
    desc2.putEnumerated(app.stringIDToTypeID("textGridding"), app.stringIDToTypeID("textGridding"), app.charIDToTypeID('None'));
    desc2.putEnumerated(app.charIDToTypeID('Ornt'), app.charIDToTypeID('Ornt'), app.charIDToTypeID('Hrzn'));
    desc2.putEnumerated(app.charIDToTypeID('AntA'), app.charIDToTypeID('Annt'), app.charIDToTypeID('AnSm'));
    var desc5 = new ActionDescriptor();
    desc5.putUnitDouble(app.charIDToTypeID('Left'), app.charIDToTypeID('#Pxl'), 0);
    desc5.putUnitDouble(app.charIDToTypeID('Top '), app.charIDToTypeID('#Pxl'), -8.21296691894531);
    desc5.putUnitDouble(app.charIDToTypeID('Rght'), app.charIDToTypeID('#Pxl'), 2600.32397460938);
    desc5.putUnitDouble(app.charIDToTypeID('Btom'), app.charIDToTypeID('#Pxl'), 1006.37817382812);
    desc2.putObject(app.stringIDToTypeID("bounds"), app.stringIDToTypeID("bounds"), desc5);
    var desc6 = new ActionDescriptor();
    desc6.putUnitDouble(app.charIDToTypeID('Left'), app.charIDToTypeID('#Pxl'), 1170.75366210938);
    desc6.putUnitDouble(app.charIDToTypeID('Top '), app.charIDToTypeID('#Pxl'), 0.01799011230469);
    desc6.putUnitDouble(app.charIDToTypeID('Rght'), app.charIDToTypeID('#Pxl'), 1440.09008789062);
    desc6.putUnitDouble(app.charIDToTypeID('Btom'), app.charIDToTypeID('#Pxl'), 67.0179901123047);
    desc2.putObject(app.stringIDToTypeID("boundingBox"), app.stringIDToTypeID("boundingBox"), desc6);
    var list1 = new ActionList();
    var desc7 = new ActionDescriptor();
    desc7.putEnumerated(app.stringIDToTypeID("textType"), app.stringIDToTypeID("textType"), app.stringIDToTypeID("box"));
    desc7.putEnumerated(app.charIDToTypeID('Ornt'), app.charIDToTypeID('Ornt'), app.charIDToTypeID('Hrzn'));
    var desc8 = new ActionDescriptor();
    desc8.putDouble(app.stringIDToTypeID("xx"), 1);
    desc8.putDouble(app.stringIDToTypeID("xy"), 0);
    desc8.putDouble(app.stringIDToTypeID("yx"), 0);
    desc8.putDouble(app.stringIDToTypeID("yy"), 1);
    desc8.putDouble(app.stringIDToTypeID("tx"), 0);
    desc8.putDouble(app.stringIDToTypeID("ty"), 0);
    desc7.putObject(app.charIDToTypeID('Trnf'), app.charIDToTypeID('Trnf'), desc8);
    desc7.putInteger(app.stringIDToTypeID("rowCount"), 1);
    desc7.putInteger(app.stringIDToTypeID("columnCount"), 1);
    desc7.putBoolean(app.stringIDToTypeID("rowMajorOrder"), true);
    desc7.putUnitDouble(app.stringIDToTypeID("rowGutter"), app.charIDToTypeID('#Pxl'), 0);
    desc7.putUnitDouble(app.stringIDToTypeID("columnGutter"), app.charIDToTypeID('#Pxl'), 0);
    desc7.putUnitDouble(app.charIDToTypeID('Spcn'), app.charIDToTypeID('#Pxl'), 0);
    desc7.putEnumerated(app.stringIDToTypeID("frameBaselineAlignment"), app.stringIDToTypeID("frameBaselineAlignment"), app.stringIDToTypeID("alignByAscent"));
    desc7.putUnitDouble(app.stringIDToTypeID("firstBaselineMinimum"), app.charIDToTypeID('#Pxl'), 0);
    var desc9 = new ActionDescriptor();
    desc9.putDouble(app.charIDToTypeID('Top '), 0);
    desc9.putDouble(app.charIDToTypeID('Left'), 0);
    desc9.putDouble(app.charIDToTypeID('Btom'), 241.53076171875);
    desc9.putDouble(app.charIDToTypeID('Rght'), 624.077758789062);
    desc7.putObject(app.stringIDToTypeID("bounds"), app.charIDToTypeID('Rctn'), desc9);
    list1.putObject(app.stringIDToTypeID("textShape"), desc7);
    desc2.putList(app.stringIDToTypeID("textShape"), list1);
    var list2 = new ActionList();
    var desc10 = new ActionDescriptor();
    desc10.putInteger(app.charIDToTypeID('From'), 0);
    desc10.putInteger(app.charIDToTypeID('T   '), 6);
    var desc11 = new ActionDescriptor();
    desc11.putBoolean(app.stringIDToTypeID("styleSheetHasParent"), true);
    desc11.putString(app.stringIDToTypeID("fontPostScriptName"), "ComicSansMS");
    desc11.putString(app.charIDToTypeID('FntN'), "Comic Sans MS");
    desc11.putString(app.charIDToTypeID('FntS'), "Bold Italic");
    desc11.putInteger(app.charIDToTypeID('Scrp'), 0);
    desc11.putInteger(app.charIDToTypeID('FntT'), 1);
    desc11.putUnitDouble(app.charIDToTypeID('Sz  '), app.charIDToTypeID('#Pxl'), 81);
    desc11.putDouble(app.charIDToTypeID('HrzS'), 100);
    desc11.putDouble(app.charIDToTypeID('VrtS'), 100);
    desc11.putBoolean(app.stringIDToTypeID("syntheticBold"), false);
    desc11.putBoolean(app.stringIDToTypeID("syntheticItalic"), false);
    desc11.putBoolean(app.stringIDToTypeID("autoLeading"), true);
    desc11.putInteger(app.charIDToTypeID('Trck'), 0);
    desc11.putUnitDouble(app.charIDToTypeID('Bsln'), app.charIDToTypeID('#Pxl'), 0);
    desc11.putEnumerated(app.charIDToTypeID('AtKr'), app.charIDToTypeID('AtKr'), app.stringIDToTypeID("metricsKern"));
    desc11.putEnumerated(app.stringIDToTypeID("fontCaps"), app.stringIDToTypeID("fontCaps"), app.charIDToTypeID('Nrml'));
    desc11.putEnumerated(app.stringIDToTypeID("digitSet"), app.stringIDToTypeID("digitSet"), app.stringIDToTypeID("defaultDigits"));
    desc11.putEnumerated(app.stringIDToTypeID("kashidas"), app.stringIDToTypeID("kashidas"), app.stringIDToTypeID("kashidaDefault"));
    desc11.putUnitDouble(app.stringIDToTypeID("diacXOffset"), app.charIDToTypeID('#Pxl'), 0);
    desc11.putUnitDouble(app.stringIDToTypeID("diacYOffset"), app.charIDToTypeID('#Pxl'), 0);
    desc11.putUnitDouble(app.stringIDToTypeID("markYDistFromBaseline"), app.charIDToTypeID('#Pxl'), 1.38240003585815);
    desc11.putEnumerated(app.stringIDToTypeID("baseline"), app.stringIDToTypeID("baseline"), app.charIDToTypeID('Nrml'));
    desc11.putEnumerated(app.stringIDToTypeID("strikethrough"), app.stringIDToTypeID("strikethrough"), app.stringIDToTypeID("strikethroughOff"));
    desc11.putEnumerated(app.charIDToTypeID('Undl'), app.charIDToTypeID('Undl'), app.stringIDToTypeID("underlineOff"));
    desc11.putBoolean(app.stringIDToTypeID("ligature"), true);
    desc11.putBoolean(app.stringIDToTypeID("altligature"), false);
    desc11.putBoolean(app.stringIDToTypeID("contextualLigatures"), false);
    desc11.putBoolean(app.stringIDToTypeID("fractions"), false);
    desc11.putBoolean(app.stringIDToTypeID("ordinals"), false);
    desc11.putBoolean(app.stringIDToTypeID("swash"), false);
    desc11.putBoolean(app.stringIDToTypeID("titling"), false);
    desc11.putBoolean(app.stringIDToTypeID("connectionForms"), false);
    desc11.putBoolean(app.stringIDToTypeID("stylisticAlternates"), false);
    desc11.putBoolean(app.stringIDToTypeID("ornaments"), false);
    desc11.putBoolean(app.stringIDToTypeID("justificationAlternates"), false);
    desc11.putEnumerated(app.stringIDToTypeID("figureStyle"), app.stringIDToTypeID("figureStyle"), app.charIDToTypeID('Nrml'));
    desc11.putBoolean(app.stringIDToTypeID("proportionalMetrics"), false);
    desc11.putBoolean(app.charIDToTypeID('kana'), false);
    desc11.putBoolean(app.stringIDToTypeID("italics"), false);
    desc11.putEnumerated(app.stringIDToTypeID("baselineDirection"), app.stringIDToTypeID("baselineDirection"), app.stringIDToTypeID("withStream"));
    desc11.putEnumerated(app.stringIDToTypeID("textLanguage"), app.stringIDToTypeID("textLanguage"), app.stringIDToTypeID("englishLanguage"));
    desc11.putEnumerated(app.stringIDToTypeID("japaneseAlternate"), app.stringIDToTypeID("japaneseAlternate"), app.stringIDToTypeID("defaultForm"));
    desc11.putDouble(app.stringIDToTypeID("mojiZume"), 0);
    desc11.putEnumerated(app.stringIDToTypeID("gridAlignment"), app.stringIDToTypeID("gridAlignment"), app.stringIDToTypeID("roman"));
    desc11.putBoolean(app.stringIDToTypeID("noBreak"), false);
    var desc12 = new ActionDescriptor();
    desc12.putDouble(app.charIDToTypeID('Rd  '), 255);
    desc12.putDouble(app.charIDToTypeID('Grn '), 255);
    desc12.putDouble(app.charIDToTypeID('Bl  '), 255);
    desc11.putObject(app.charIDToTypeID('Clr '), app.stringIDToTypeID("RGBColor"), desc12);
    var desc13 = new ActionDescriptor();
    desc13.putDouble(app.charIDToTypeID('Rd  '), 0);
    desc13.putDouble(app.charIDToTypeID('Grn '), 0);
    desc13.putDouble(app.charIDToTypeID('Bl  '), 0);
    desc11.putObject(app.stringIDToTypeID("strokeColor"), app.stringIDToTypeID("RGBColor"), desc13);
    var desc14 = new ActionDescriptor();
    desc14.putString(app.stringIDToTypeID("fontPostScriptName"), "MyriadPro-Regular");
    desc14.putString(app.charIDToTypeID('FntN'), "Myriad Pro");
    desc14.putString(app.charIDToTypeID('FntS'), "Regular");
    desc14.putInteger(app.charIDToTypeID('Scrp'), 0);
    desc14.putInteger(app.charIDToTypeID('FntT'), 0);
    desc14.putUnitDouble(app.charIDToTypeID('Sz  '), app.charIDToTypeID('#Pxl'), 12);
    desc14.putDouble(app.charIDToTypeID('HrzS'), 100);
    desc14.putDouble(app.charIDToTypeID('VrtS'), 100);
    desc14.putBoolean(app.stringIDToTypeID("syntheticBold"), false);
    desc14.putBoolean(app.stringIDToTypeID("syntheticItalic"), false);
    desc14.putBoolean(app.stringIDToTypeID("autoLeading"), true);
    desc14.putInteger(app.charIDToTypeID('Trck'), 0);
    desc14.putUnitDouble(app.charIDToTypeID('Bsln'), app.charIDToTypeID('#Pxl'), 0);
    desc14.putDouble(app.stringIDToTypeID("characterRotation"), 0);
    desc14.putEnumerated(app.charIDToTypeID('AtKr'), app.charIDToTypeID('AtKr'), app.stringIDToTypeID("metricsKern"));
    desc14.putEnumerated(app.stringIDToTypeID("fontCaps"), app.stringIDToTypeID("fontCaps"), app.charIDToTypeID('Nrml'));
    desc14.putEnumerated(app.stringIDToTypeID("digitSet"), app.stringIDToTypeID("digitSet"), app.stringIDToTypeID("defaultDigits"));
    desc14.putEnumerated(app.stringIDToTypeID("dirOverride"), app.stringIDToTypeID("dirOverride"), app.stringIDToTypeID("dirOverrideDefault"));
    desc14.putEnumerated(app.stringIDToTypeID("kashidas"), app.stringIDToTypeID("kashidas"), app.stringIDToTypeID("kashidaDefault"));
    desc14.putEnumerated(app.stringIDToTypeID("diacVPos"), app.stringIDToTypeID("diacVPos"), app.stringIDToTypeID("diacVPosOpenType"));
    desc14.putUnitDouble(app.stringIDToTypeID("diacXOffset"), app.charIDToTypeID('#Pxl'), 0);
    desc14.putUnitDouble(app.stringIDToTypeID("diacYOffset"), app.charIDToTypeID('#Pxl'), 0);
    desc14.putUnitDouble(app.stringIDToTypeID("markYDistFromBaseline"), app.charIDToTypeID('#Pxl'), 100);
    desc14.putEnumerated(app.stringIDToTypeID("baseline"), app.stringIDToTypeID("baseline"), app.charIDToTypeID('Nrml'));
    desc14.putEnumerated(app.stringIDToTypeID("otbaseline"), app.stringIDToTypeID("otbaseline"), app.charIDToTypeID('Nrml'));
    desc14.putEnumerated(app.stringIDToTypeID("strikethrough"), app.stringIDToTypeID("strikethrough"), app.stringIDToTypeID("strikethroughOff"));
    desc14.putEnumerated(app.charIDToTypeID('Undl'), app.charIDToTypeID('Undl'), app.stringIDToTypeID("underlineOff"));
    desc14.putUnitDouble(app.stringIDToTypeID("underlineOffset"), app.charIDToTypeID('#Pxl'), 0);
    desc14.putBoolean(app.stringIDToTypeID("ligature"), true);
    desc14.putBoolean(app.stringIDToTypeID("altligature"), false);
    desc14.putBoolean(app.stringIDToTypeID("contextualLigatures"), false);
    desc14.putBoolean(app.stringIDToTypeID("alternateLigatures"), false);
    desc14.putBoolean(app.stringIDToTypeID("oldStyle"), false);
    desc14.putBoolean(app.stringIDToTypeID("fractions"), false);
    desc14.putBoolean(app.stringIDToTypeID("ordinals"), false);
    desc14.putBoolean(app.stringIDToTypeID("swash"), false);
    desc14.putBoolean(app.stringIDToTypeID("titling"), false);
    desc14.putBoolean(app.stringIDToTypeID("connectionForms"), false);
    desc14.putBoolean(app.stringIDToTypeID("stylisticAlternates"), false);
    desc14.putBoolean(app.stringIDToTypeID("ornaments"), false);
    desc14.putBoolean(app.stringIDToTypeID("justificationAlternates"), false);
    desc14.putEnumerated(app.stringIDToTypeID("figureStyle"), app.stringIDToTypeID("figureStyle"), app.charIDToTypeID('Nrml'));
    desc14.putBoolean(app.stringIDToTypeID("proportionalMetrics"), false);
    desc14.putBoolean(app.charIDToTypeID('kana'), false);
    desc14.putBoolean(app.stringIDToTypeID("italics"), false);
    desc14.putBoolean(app.charIDToTypeID('ruby'), false);
    desc14.putEnumerated(app.stringIDToTypeID("baselineDirection"), app.stringIDToTypeID("baselineDirection"), app.stringIDToTypeID("rotated"));
    desc14.putEnumerated(app.stringIDToTypeID("textLanguage"), app.stringIDToTypeID("textLanguage"), app.stringIDToTypeID("englishLanguage"));
    desc14.putEnumerated(app.stringIDToTypeID("japaneseAlternate"), app.stringIDToTypeID("japaneseAlternate"), app.stringIDToTypeID("defaultForm"));
    desc14.putDouble(app.stringIDToTypeID("mojiZume"), 0);
    desc14.putEnumerated(app.stringIDToTypeID("gridAlignment"), app.stringIDToTypeID("gridAlignment"), app.stringIDToTypeID("roman"));
    desc14.putBoolean(app.stringIDToTypeID("enableWariChu"), false);
    desc14.putInteger(app.stringIDToTypeID("wariChuCount"), 2);
    desc14.putInteger(app.stringIDToTypeID("wariChuLineGap"), 0);
    desc14.putDouble(app.stringIDToTypeID("wariChuScale"), 0.5);
    desc14.putInteger(app.stringIDToTypeID("wariChuWidow"), 2);
    desc14.putInteger(app.stringIDToTypeID("wariChuOrphan"), 2);
    desc14.putEnumerated(app.stringIDToTypeID("wariChuJustification"), app.stringIDToTypeID("wariChuJustification"), app.stringIDToTypeID("wariChuAutoJustify"));
    desc14.putInteger(app.stringIDToTypeID("tcyUpDown"), 0);
    desc14.putInteger(app.stringIDToTypeID("tcyLeftRight"), 0);
    desc14.putDouble(app.stringIDToTypeID("leftAki"), -1);
    desc14.putDouble(app.stringIDToTypeID("rightAki"), -1);
    desc14.putInteger(app.stringIDToTypeID("jiDori"), 0);
    desc14.putBoolean(app.stringIDToTypeID("noBreak"), false);
    var desc15 = new ActionDescriptor();
    desc15.putDouble(app.charIDToTypeID('Rd  '), 0);
    desc15.putDouble(app.charIDToTypeID('Grn '), 0);
    desc15.putDouble(app.charIDToTypeID('Bl  '), 0);
    desc14.putObject(app.charIDToTypeID('Clr '), app.stringIDToTypeID("RGBColor"), desc15);
    var desc16 = new ActionDescriptor();
    desc16.putDouble(app.charIDToTypeID('Rd  '), 0);
    desc16.putDouble(app.charIDToTypeID('Grn '), 0);
    desc16.putDouble(app.charIDToTypeID('Bl  '), 0);
    desc14.putObject(app.stringIDToTypeID("strokeColor"), app.stringIDToTypeID("RGBColor"), desc16);
    desc14.putBoolean(app.charIDToTypeID('Fl  '), true);
    desc14.putBoolean(app.charIDToTypeID('Strk'), false);
    desc14.putBoolean(app.stringIDToTypeID("fillFirst"), true);
    desc14.putBoolean(app.stringIDToTypeID("fillOverPrint"), false);
    desc14.putBoolean(app.stringIDToTypeID("strokeOverPrint"), false);
    desc14.putEnumerated(app.stringIDToTypeID("lineCap"), app.stringIDToTypeID("lineCap"), app.stringIDToTypeID("buttCap"));
    desc14.putEnumerated(app.stringIDToTypeID("lineJoin"), app.stringIDToTypeID("lineJoin"), app.stringIDToTypeID("miterJoin"));
    desc14.putUnitDouble(app.stringIDToTypeID("lineWidth"), app.charIDToTypeID('#Pxl'), 1);
    desc14.putUnitDouble(app.stringIDToTypeID("miterLimit"), app.charIDToTypeID('#Pxl'), 4);
    desc14.putDouble(app.stringIDToTypeID("lineDashoffset"), 0);
    desc11.putObject(app.stringIDToTypeID("baseParentStyle"), app.charIDToTypeID('TxtS'), desc14);
    desc10.putObject(app.charIDToTypeID('TxtS'), app.charIDToTypeID('TxtS'), desc11);
    list2.putObject(app.charIDToTypeID('Txtt'), desc10);
    desc2.putList(app.charIDToTypeID('Txtt'), list2);
    var list3 = new ActionList();
    var desc17 = new ActionDescriptor();
    desc17.putInteger(app.charIDToTypeID('From'), 0);
    desc17.putInteger(app.charIDToTypeID('T   '), 6);
    var desc18 = new ActionDescriptor();
    desc18.putBoolean(app.stringIDToTypeID("styleSheetHasParent"), true);
    desc18.putEnumerated(app.charIDToTypeID('Algn'), app.charIDToTypeID('Alg '), app.charIDToTypeID('Cntr'));
    desc18.putUnitDouble(app.stringIDToTypeID("firstLineIndent"), app.charIDToTypeID('#Pxl'), 0);
    desc18.putUnitDouble(app.stringIDToTypeID("startIndent"), app.charIDToTypeID('#Pxl'), 0);
    desc18.putUnitDouble(app.stringIDToTypeID("endIndent"), app.charIDToTypeID('#Pxl'), 0);
    desc18.putUnitDouble(app.stringIDToTypeID("spaceBefore"), app.charIDToTypeID('#Pxl'), 0);
    desc18.putUnitDouble(app.stringIDToTypeID("spaceAfter"), app.charIDToTypeID('#Pxl'), 0);
    desc18.putDouble(app.stringIDToTypeID("autoLeadingPercentage"), 1.20000004768372);
    desc18.putEnumerated(app.stringIDToTypeID("leadingType"), app.stringIDToTypeID("leadingType"), app.stringIDToTypeID("leadingBelow"));
    desc18.putEnumerated(app.stringIDToTypeID("directionType"), app.stringIDToTypeID("directionType"), app.stringIDToTypeID("dirLeftToRight"));
    desc18.putEnumerated(app.stringIDToTypeID("kashidaWidthType"), app.stringIDToTypeID("kashidaWidthType"), app.stringIDToTypeID("kashidaWidthMedium"));
    desc18.putBoolean(app.stringIDToTypeID("hyphenate"), false);
    desc18.putDouble(app.stringIDToTypeID("justificationWordMinimum"), 0.80000001192093);
    desc18.putDouble(app.stringIDToTypeID("justificationWordDesired"), 1);
    desc18.putDouble(app.stringIDToTypeID("justificationWordMaximum"), 1.33000004291534);
    desc18.putDouble(app.stringIDToTypeID("justificationLetterMinimum"), 0);
    desc18.putDouble(app.stringIDToTypeID("justificationLetterDesired"), 0);
    desc18.putDouble(app.stringIDToTypeID("justificationLetterMaximum"), 0);
    desc18.putDouble(app.stringIDToTypeID("justificationGlyphMinimum"), 1);
    desc18.putDouble(app.stringIDToTypeID("justificationGlyphDesired"), 1);
    desc18.putDouble(app.stringIDToTypeID("justificationGlyphMaximum"), 1);
    desc18.putBoolean(app.stringIDToTypeID("hangingRoman"), false);
    desc18.putEnumerated(app.stringIDToTypeID("burasagari"), app.stringIDToTypeID("burasagari"), app.stringIDToTypeID("burasagariStandard"));
    desc18.putEnumerated(app.stringIDToTypeID("preferredKinsokuOrder"), app.stringIDToTypeID("preferredKinsokuOrder"), app.stringIDToTypeID("pushIn"));
    desc18.putBoolean(app.stringIDToTypeID("textEveryLineComposer"), true);
    desc18.putEnumerated(app.stringIDToTypeID("textComposerEngine"), app.stringIDToTypeID("textComposerEngine"), app.stringIDToTypeID("textLatinCJKComposer"));
    desc17.putObject(app.stringIDToTypeID("paragraphStyle"), app.stringIDToTypeID("paragraphStyle"), desc18);
    list3.putObject(app.stringIDToTypeID("paragraphStyleRange"), desc17);
    desc2.putList(app.stringIDToTypeID("paragraphStyleRange"), list3);
    var list4 = new ActionList();
    desc2.putList(app.stringIDToTypeID("kerningRange"), list4);
    desc1.putObject(app.charIDToTypeID('Usng'), app.charIDToTypeID('TxLr'), desc2);
    executeAction(app.charIDToTypeID('Mk  '), desc1, dialogMode);
    
    var desc1 = new ActionDescriptor();
    var ref1 = new ActionReference();
    ref1.putEnumerated(app.charIDToTypeID('TxLr'), app.charIDToTypeID('Ordn'), app.charIDToTypeID('Trgt'));
    desc1.putReference(app.charIDToTypeID('null'), ref1);
    var desc2 = new ActionDescriptor();
    desc2.putString(app.charIDToTypeID('Txt '), "BOOM!");
    var desc3 = new ActionDescriptor();
    desc3.putEnumerated(app.stringIDToTypeID("warpStyle"), app.stringIDToTypeID("warpStyle"), app.stringIDToTypeID("warpBulge"));
    desc3.putDouble(app.stringIDToTypeID("warpValue"), 14);
    desc3.putDouble(app.stringIDToTypeID("warpPerspective"), 0);
    desc3.putDouble(app.stringIDToTypeID("warpPerspectiveOther"), -3);
    desc3.putEnumerated(app.stringIDToTypeID("warpRotate"), app.charIDToTypeID('Ornt'), app.charIDToTypeID('Hrzn'));
    desc2.putObject(app.charIDToTypeID('warp'), app.charIDToTypeID('warp'), desc3);
    desc2.putEnumerated(app.stringIDToTypeID("textGridding"), app.stringIDToTypeID("textGridding"), app.charIDToTypeID('None'));
    desc2.putEnumerated(app.charIDToTypeID('Ornt'), app.charIDToTypeID('Ornt'), app.charIDToTypeID('Hrzn'));
    desc2.putEnumerated(app.charIDToTypeID('AntA'), app.charIDToTypeID('Annt'), app.charIDToTypeID('AnSm'));
    var desc4 = new ActionDescriptor();
    desc4.putUnitDouble(app.charIDToTypeID('Left'), app.charIDToTypeID('#Pxl'), 0);
    desc4.putUnitDouble(app.charIDToTypeID('Top '), app.charIDToTypeID('#Pxl'), -17.4145202636719);
    desc4.putUnitDouble(app.charIDToTypeID('Rght'), app.charIDToTypeID('#Pxl'), 2600.32397460938);
    desc4.putUnitDouble(app.charIDToTypeID('Btom'), app.charIDToTypeID('#Pxl'), 581.590576171875);
    desc2.putObject(app.stringIDToTypeID("bounds"), app.stringIDToTypeID("bounds"), desc4);
    var desc5 = new ActionDescriptor();
    desc5.putUnitDouble(app.charIDToTypeID('Left'), app.charIDToTypeID('#Pxl'), 1087.40356445312);
    desc5.putUnitDouble(app.charIDToTypeID('Top '), app.charIDToTypeID('#Pxl'), -2.90548706054688);
    desc5.putUnitDouble(app.charIDToTypeID('Rght'), app.charIDToTypeID('#Pxl'), 1516.82690429688);
    desc5.putUnitDouble(app.charIDToTypeID('Btom'), app.charIDToTypeID('#Pxl'), 135.094512939453);
    desc2.putObject(app.stringIDToTypeID("boundingBox"), app.stringIDToTypeID("boundingBox"), desc5);
    var list1 = new ActionList();
    var desc6 = new ActionDescriptor();
    desc6.putEnumerated(app.stringIDToTypeID("textType"), app.stringIDToTypeID("textType"), app.stringIDToTypeID("box"));
    desc6.putEnumerated(app.charIDToTypeID('Ornt'), app.charIDToTypeID('Ornt'), app.charIDToTypeID('Hrzn'));
    var desc7 = new ActionDescriptor();
    desc7.putDouble(app.stringIDToTypeID("xx"), 1);
    desc7.putDouble(app.stringIDToTypeID("xy"), 0);
    desc7.putDouble(app.stringIDToTypeID("yx"), 0);
    desc7.putDouble(app.stringIDToTypeID("yy"), 1);
    desc7.putDouble(app.stringIDToTypeID("tx"), 0);
    desc7.putDouble(app.stringIDToTypeID("ty"), 0);
    desc6.putObject(app.charIDToTypeID('Trnf'), app.charIDToTypeID('Trnf'), desc7);
    desc6.putInteger(app.stringIDToTypeID("rowCount"), 1);
    desc6.putInteger(app.stringIDToTypeID("columnCount"), 1);
    desc6.putBoolean(app.stringIDToTypeID("rowMajorOrder"), true);
    desc6.putUnitDouble(app.stringIDToTypeID("rowGutter"), app.charIDToTypeID('#Pxl'), 0);
    desc6.putUnitDouble(app.stringIDToTypeID("columnGutter"), app.charIDToTypeID('#Pxl'), 0);
    desc6.putUnitDouble(app.charIDToTypeID('Spcn'), app.charIDToTypeID('#Pxl'), 0);
    desc6.putEnumerated(app.stringIDToTypeID("frameBaselineAlignment"), app.stringIDToTypeID("frameBaselineAlignment"), app.stringIDToTypeID("alignByAscent"));
    desc6.putUnitDouble(app.stringIDToTypeID("firstBaselineMinimum"), app.charIDToTypeID('#Pxl'), 0);
    var desc8 = new ActionDescriptor();
    desc8.putDouble(app.charIDToTypeID('Top '), 0);
    desc8.putDouble(app.charIDToTypeID('Left'), 0);
    desc8.putDouble(app.charIDToTypeID('Btom'), 139.581741333008);
    desc8.putDouble(app.charIDToTypeID('Rght'), 624.077758789062);
    desc6.putObject(app.stringIDToTypeID("bounds"), app.charIDToTypeID('Rctn'), desc8);
    list1.putObject(app.stringIDToTypeID("textShape"), desc6);
    desc2.putList(app.stringIDToTypeID("textShape"), list1);
    var list2 = new ActionList();
    var desc9 = new ActionDescriptor();
    desc9.putInteger(app.charIDToTypeID('From'), 0);
    desc9.putInteger(app.charIDToTypeID('T   '), 6);
    var desc10 = new ActionDescriptor();
    desc10.putBoolean(app.stringIDToTypeID("styleSheetHasParent"), true);
    desc10.putString(app.stringIDToTypeID("fontPostScriptName"), "Impact");
    desc10.putString(app.charIDToTypeID('FntN'), "Impact");
    desc10.putString(app.charIDToTypeID('FntS'), "Regular");
    desc10.putInteger(app.charIDToTypeID('Scrp'), 0);
    desc10.putInteger(app.charIDToTypeID('FntT'), 1);
    desc10.putUnitDouble(app.charIDToTypeID('Sz  '), app.charIDToTypeID('#Pxl'), 167);
    desc10.putDouble(app.charIDToTypeID('HrzS'), 100);
    desc10.putDouble(app.charIDToTypeID('VrtS'), 100);
    desc10.putBoolean(app.stringIDToTypeID("syntheticBold"), false);
    desc10.putBoolean(app.stringIDToTypeID("syntheticItalic"), false);
    desc10.putBoolean(app.stringIDToTypeID("autoLeading"), true);
    desc10.putInteger(app.charIDToTypeID('Trck'), 0);
    desc10.putUnitDouble(app.charIDToTypeID('Bsln'), app.charIDToTypeID('#Pxl'), 0);
    desc10.putEnumerated(app.charIDToTypeID('AtKr'), app.charIDToTypeID('AtKr'), app.stringIDToTypeID("metricsKern"));
    desc10.putEnumerated(app.stringIDToTypeID("fontCaps"), app.stringIDToTypeID("fontCaps"), app.charIDToTypeID('Nrml'));
    desc10.putEnumerated(app.stringIDToTypeID("digitSet"), app.stringIDToTypeID("digitSet"), app.stringIDToTypeID("defaultDigits"));
    desc10.putEnumerated(app.stringIDToTypeID("kashidas"), app.stringIDToTypeID("kashidas"), app.stringIDToTypeID("kashidaDefault"));
    desc10.putUnitDouble(app.stringIDToTypeID("diacXOffset"), app.charIDToTypeID('#Pxl'), 0);
    desc10.putUnitDouble(app.stringIDToTypeID("diacYOffset"), app.charIDToTypeID('#Pxl'), 0);
    desc10.putUnitDouble(app.stringIDToTypeID("markYDistFromBaseline"), app.charIDToTypeID('#Pxl'), 1.38240003585815);
    desc10.putEnumerated(app.stringIDToTypeID("baseline"), app.stringIDToTypeID("baseline"), app.charIDToTypeID('Nrml'));
    desc10.putEnumerated(app.stringIDToTypeID("strikethrough"), app.stringIDToTypeID("strikethrough"), app.stringIDToTypeID("strikethroughOff"));
    desc10.putEnumerated(app.charIDToTypeID('Undl'), app.charIDToTypeID('Undl'), app.stringIDToTypeID("underlineOff"));
    desc10.putBoolean(app.stringIDToTypeID("ligature"), true);
    desc10.putBoolean(app.stringIDToTypeID("altligature"), false);
    desc10.putBoolean(app.stringIDToTypeID("contextualLigatures"), false);
    desc10.putBoolean(app.stringIDToTypeID("fractions"), false);
    desc10.putBoolean(app.stringIDToTypeID("ordinals"), false);
    desc10.putBoolean(app.stringIDToTypeID("swash"), false);
    desc10.putBoolean(app.stringIDToTypeID("titling"), false);
    desc10.putBoolean(app.stringIDToTypeID("connectionForms"), false);
    desc10.putBoolean(app.stringIDToTypeID("stylisticAlternates"), false);
    desc10.putBoolean(app.stringIDToTypeID("ornaments"), false);
    desc10.putBoolean(app.stringIDToTypeID("justificationAlternates"), false);
    desc10.putEnumerated(app.stringIDToTypeID("figureStyle"), app.stringIDToTypeID("figureStyle"), app.charIDToTypeID('Nrml'));
    desc10.putBoolean(app.stringIDToTypeID("proportionalMetrics"), false);
    desc10.putBoolean(app.charIDToTypeID('kana'), false);
    desc10.putBoolean(app.stringIDToTypeID("italics"), false);
    desc10.putEnumerated(app.stringIDToTypeID("baselineDirection"), app.stringIDToTypeID("baselineDirection"), app.stringIDToTypeID("withStream"));
    desc10.putEnumerated(app.stringIDToTypeID("textLanguage"), app.stringIDToTypeID("textLanguage"), app.stringIDToTypeID("englishLanguage"));
    desc10.putEnumerated(app.stringIDToTypeID("japaneseAlternate"), app.stringIDToTypeID("japaneseAlternate"), app.stringIDToTypeID("defaultForm"));
    desc10.putDouble(app.stringIDToTypeID("mojiZume"), 0);
    desc10.putEnumerated(app.stringIDToTypeID("gridAlignment"), app.stringIDToTypeID("gridAlignment"), app.stringIDToTypeID("roman"));
    desc10.putBoolean(app.stringIDToTypeID("noBreak"), false);
    var desc11 = new ActionDescriptor();
    desc11.putDouble(app.charIDToTypeID('Rd  '), 254.785995483398);
    desc11.putDouble(app.charIDToTypeID('Grn '), 255);
    desc11.putDouble(app.charIDToTypeID('Bl  '), 0);
    desc10.putObject(app.charIDToTypeID('Clr '), app.stringIDToTypeID("RGBColor"), desc11);
    var desc12 = new ActionDescriptor();
    desc12.putDouble(app.charIDToTypeID('Rd  '), 0);
    desc12.putDouble(app.charIDToTypeID('Grn '), 0);
    desc12.putDouble(app.charIDToTypeID('Bl  '), 0);
    desc10.putObject(app.stringIDToTypeID("strokeColor"), app.stringIDToTypeID("RGBColor"), desc12);
    var desc13 = new ActionDescriptor();
    desc13.putString(app.stringIDToTypeID("fontPostScriptName"), "MyriadPro-Regular");
    desc13.putString(app.charIDToTypeID('FntN'), "Myriad Pro");
    desc13.putString(app.charIDToTypeID('FntS'), "Regular");
    desc13.putInteger(app.charIDToTypeID('Scrp'), 0);
    desc13.putInteger(app.charIDToTypeID('FntT'), 0);
    desc13.putUnitDouble(app.charIDToTypeID('Sz  '), app.charIDToTypeID('#Pxl'), 12);
    desc13.putDouble(app.charIDToTypeID('HrzS'), 100);
    desc13.putDouble(app.charIDToTypeID('VrtS'), 100);
    desc13.putBoolean(app.stringIDToTypeID("syntheticBold"), false);
    desc13.putBoolean(app.stringIDToTypeID("syntheticItalic"), false);
    desc13.putBoolean(app.stringIDToTypeID("autoLeading"), true);
    desc13.putInteger(app.charIDToTypeID('Trck'), 0);
    desc13.putUnitDouble(app.charIDToTypeID('Bsln'), app.charIDToTypeID('#Pxl'), 0);
    desc13.putDouble(app.stringIDToTypeID("characterRotation"), 0);
    desc13.putEnumerated(app.charIDToTypeID('AtKr'), app.charIDToTypeID('AtKr'), app.stringIDToTypeID("metricsKern"));
    desc13.putEnumerated(app.stringIDToTypeID("fontCaps"), app.stringIDToTypeID("fontCaps"), app.charIDToTypeID('Nrml'));
    desc13.putEnumerated(app.stringIDToTypeID("digitSet"), app.stringIDToTypeID("digitSet"), app.stringIDToTypeID("defaultDigits"));
    desc13.putEnumerated(app.stringIDToTypeID("dirOverride"), app.stringIDToTypeID("dirOverride"), app.stringIDToTypeID("dirOverrideDefault"));
    desc13.putEnumerated(app.stringIDToTypeID("kashidas"), app.stringIDToTypeID("kashidas"), app.stringIDToTypeID("kashidaDefault"));
    desc13.putEnumerated(app.stringIDToTypeID("diacVPos"), app.stringIDToTypeID("diacVPos"), app.stringIDToTypeID("diacVPosOpenType"));
    desc13.putUnitDouble(app.stringIDToTypeID("diacXOffset"), app.charIDToTypeID('#Pxl'), 0);
    desc13.putUnitDouble(app.stringIDToTypeID("diacYOffset"), app.charIDToTypeID('#Pxl'), 0);
    desc13.putUnitDouble(app.stringIDToTypeID("markYDistFromBaseline"), app.charIDToTypeID('#Pxl'), 100);
    desc13.putEnumerated(app.stringIDToTypeID("baseline"), app.stringIDToTypeID("baseline"), app.charIDToTypeID('Nrml'));
    desc13.putEnumerated(app.stringIDToTypeID("otbaseline"), app.stringIDToTypeID("otbaseline"), app.charIDToTypeID('Nrml'));
    desc13.putEnumerated(app.stringIDToTypeID("strikethrough"), app.stringIDToTypeID("strikethrough"), app.stringIDToTypeID("strikethroughOff"));
    desc13.putEnumerated(app.charIDToTypeID('Undl'), app.charIDToTypeID('Undl'), app.stringIDToTypeID("underlineOff"));
    desc13.putUnitDouble(app.stringIDToTypeID("underlineOffset"), app.charIDToTypeID('#Pxl'), 0);
    desc13.putBoolean(app.stringIDToTypeID("ligature"), true);
    desc13.putBoolean(app.stringIDToTypeID("altligature"), false);
    desc13.putBoolean(app.stringIDToTypeID("contextualLigatures"), false);
    desc13.putBoolean(app.stringIDToTypeID("alternateLigatures"), false);
    desc13.putBoolean(app.stringIDToTypeID("oldStyle"), false);
    desc13.putBoolean(app.stringIDToTypeID("fractions"), false);
    desc13.putBoolean(app.stringIDToTypeID("ordinals"), false);
    desc13.putBoolean(app.stringIDToTypeID("swash"), false);
    desc13.putBoolean(app.stringIDToTypeID("titling"), false);
    desc13.putBoolean(app.stringIDToTypeID("connectionForms"), false);
    desc13.putBoolean(app.stringIDToTypeID("stylisticAlternates"), false);
    desc13.putBoolean(app.stringIDToTypeID("ornaments"), false);
    desc13.putBoolean(app.stringIDToTypeID("justificationAlternates"), false);
    desc13.putEnumerated(app.stringIDToTypeID("figureStyle"), app.stringIDToTypeID("figureStyle"), app.charIDToTypeID('Nrml'));
    desc13.putBoolean(app.stringIDToTypeID("proportionalMetrics"), false);
    desc13.putBoolean(app.charIDToTypeID('kana'), false);
    desc13.putBoolean(app.stringIDToTypeID("italics"), false);
    desc13.putBoolean(app.charIDToTypeID('ruby'), false);
    desc13.putEnumerated(app.stringIDToTypeID("baselineDirection"), app.stringIDToTypeID("baselineDirection"), app.stringIDToTypeID("rotated"));
    desc13.putEnumerated(app.stringIDToTypeID("textLanguage"), app.stringIDToTypeID("textLanguage"), app.stringIDToTypeID("englishLanguage"));
    desc13.putEnumerated(app.stringIDToTypeID("japaneseAlternate"), app.stringIDToTypeID("japaneseAlternate"), app.stringIDToTypeID("defaultForm"));
    desc13.putDouble(app.stringIDToTypeID("mojiZume"), 0);
    desc13.putEnumerated(app.stringIDToTypeID("gridAlignment"), app.stringIDToTypeID("gridAlignment"), app.stringIDToTypeID("roman"));
    desc13.putBoolean(app.stringIDToTypeID("enableWariChu"), false);
    desc13.putInteger(app.stringIDToTypeID("wariChuCount"), 2);
    desc13.putInteger(app.stringIDToTypeID("wariChuLineGap"), 0);
    desc13.putDouble(app.stringIDToTypeID("wariChuScale"), 0.5);
    desc13.putInteger(app.stringIDToTypeID("wariChuWidow"), 2);
    desc13.putInteger(app.stringIDToTypeID("wariChuOrphan"), 2);
    desc13.putEnumerated(app.stringIDToTypeID("wariChuJustification"), app.stringIDToTypeID("wariChuJustification"), app.stringIDToTypeID("wariChuAutoJustify"));
    desc13.putInteger(app.stringIDToTypeID("tcyUpDown"), 0);
    desc13.putInteger(app.stringIDToTypeID("tcyLeftRight"), 0);
    desc13.putDouble(app.stringIDToTypeID("leftAki"), -1);
    desc13.putDouble(app.stringIDToTypeID("rightAki"), -1);
    desc13.putInteger(app.stringIDToTypeID("jiDori"), 0);
    desc13.putBoolean(app.stringIDToTypeID("noBreak"), false);
    var desc14 = new ActionDescriptor();
    desc14.putDouble(app.charIDToTypeID('Rd  '), 0);
    desc14.putDouble(app.charIDToTypeID('Grn '), 0);
    desc14.putDouble(app.charIDToTypeID('Bl  '), 0);
    desc13.putObject(app.charIDToTypeID('Clr '), app.stringIDToTypeID("RGBColor"), desc14);
    var desc15 = new ActionDescriptor();
    desc15.putDouble(app.charIDToTypeID('Rd  '), 0);
    desc15.putDouble(app.charIDToTypeID('Grn '), 0);
    desc15.putDouble(app.charIDToTypeID('Bl  '), 0);
    desc13.putObject(app.stringIDToTypeID("strokeColor"), app.stringIDToTypeID("RGBColor"), desc15);
    desc13.putBoolean(app.charIDToTypeID('Fl  '), true);
    desc13.putBoolean(app.charIDToTypeID('Strk'), false);
    desc13.putBoolean(app.stringIDToTypeID("fillFirst"), true);
    desc13.putBoolean(app.stringIDToTypeID("fillOverPrint"), false);
    desc13.putBoolean(app.stringIDToTypeID("strokeOverPrint"), false);
    desc13.putEnumerated(app.stringIDToTypeID("lineCap"), app.stringIDToTypeID("lineCap"), app.stringIDToTypeID("buttCap"));
    desc13.putEnumerated(app.stringIDToTypeID("lineJoin"), app.stringIDToTypeID("lineJoin"), app.stringIDToTypeID("miterJoin"));
    desc13.putUnitDouble(app.stringIDToTypeID("lineWidth"), app.charIDToTypeID('#Pxl'), 1);
    desc13.putUnitDouble(app.stringIDToTypeID("miterLimit"), app.charIDToTypeID('#Pxl'), 4);
    desc13.putDouble(app.stringIDToTypeID("lineDashoffset"), 0);
    desc10.putObject(app.stringIDToTypeID("baseParentStyle"), app.charIDToTypeID('TxtS'), desc13);
    desc9.putObject(app.charIDToTypeID('TxtS'), app.charIDToTypeID('TxtS'), desc10);
    list2.putObject(app.charIDToTypeID('Txtt'), desc9);
    desc2.putList(app.charIDToTypeID('Txtt'), list2);
    var list3 = new ActionList();
    var desc16 = new ActionDescriptor();
    desc16.putInteger(app.charIDToTypeID('From'), 0);
    desc16.putInteger(app.charIDToTypeID('T   '), 6);
    var desc17 = new ActionDescriptor();
    desc17.putBoolean(app.stringIDToTypeID("styleSheetHasParent"), true);
    desc17.putEnumerated(app.charIDToTypeID('Algn'), app.charIDToTypeID('Alg '), app.charIDToTypeID('Cntr'));
    desc17.putUnitDouble(app.stringIDToTypeID("firstLineIndent"), app.charIDToTypeID('#Pxl'), 0);
    desc17.putUnitDouble(app.stringIDToTypeID("startIndent"), app.charIDToTypeID('#Pxl'), 0);
    desc17.putUnitDouble(app.stringIDToTypeID("endIndent"), app.charIDToTypeID('#Pxl'), 0);
    desc17.putUnitDouble(app.stringIDToTypeID("spaceBefore"), app.charIDToTypeID('#Pxl'), 0);
    desc17.putUnitDouble(app.stringIDToTypeID("spaceAfter"), app.charIDToTypeID('#Pxl'), 0);
    desc17.putDouble(app.stringIDToTypeID("autoLeadingPercentage"), 1.20000004768372);
    desc17.putEnumerated(app.stringIDToTypeID("leadingType"), app.stringIDToTypeID("leadingType"), app.stringIDToTypeID("leadingBelow"));
    desc17.putEnumerated(app.stringIDToTypeID("directionType"), app.stringIDToTypeID("directionType"), app.stringIDToTypeID("dirLeftToRight"));
    desc17.putEnumerated(app.stringIDToTypeID("kashidaWidthType"), app.stringIDToTypeID("kashidaWidthType"), app.stringIDToTypeID("kashidaWidthMedium"));
    desc17.putBoolean(app.stringIDToTypeID("hyphenate"), false);
    desc17.putDouble(app.stringIDToTypeID("justificationWordMinimum"), 0.80000001192093);
    desc17.putDouble(app.stringIDToTypeID("justificationWordDesired"), 1);
    desc17.putDouble(app.stringIDToTypeID("justificationWordMaximum"), 1.33000004291534);
    desc17.putDouble(app.stringIDToTypeID("justificationLetterMinimum"), 0);
    desc17.putDouble(app.stringIDToTypeID("justificationLetterDesired"), 0);
    desc17.putDouble(app.stringIDToTypeID("justificationLetterMaximum"), 0);
    desc17.putDouble(app.stringIDToTypeID("justificationGlyphMinimum"), 1);
    desc17.putDouble(app.stringIDToTypeID("justificationGlyphDesired"), 1);
    desc17.putDouble(app.stringIDToTypeID("justificationGlyphMaximum"), 1);
    desc17.putBoolean(app.stringIDToTypeID("hangingRoman"), false);
    desc17.putEnumerated(app.stringIDToTypeID("burasagari"), app.stringIDToTypeID("burasagari"), app.stringIDToTypeID("burasagariStandard"));
    desc17.putEnumerated(app.stringIDToTypeID("preferredKinsokuOrder"), app.stringIDToTypeID("preferredKinsokuOrder"), app.stringIDToTypeID("pushIn"));
    desc17.putBoolean(app.stringIDToTypeID("textEveryLineComposer"), true);
    desc17.putEnumerated(app.stringIDToTypeID("textComposerEngine"), app.stringIDToTypeID("textComposerEngine"), app.stringIDToTypeID("textLatinCJKComposer"));
    desc16.putObject(app.stringIDToTypeID("paragraphStyle"), app.stringIDToTypeID("paragraphStyle"), desc17);
    list3.putObject(app.stringIDToTypeID("paragraphStyleRange"), desc16);
    desc2.putList(app.stringIDToTypeID("paragraphStyleRange"), list3);
    var list4 = new ActionList();
    desc2.putList(app.stringIDToTypeID("kerningRange"), list4);
    desc1.putObject(app.charIDToTypeID('T   '), app.charIDToTypeID('TxLr'), desc2);
    executeAction(app.charIDToTypeID('setd'), desc1, dialogMode);
    
    //warp1
    var idsetd = charIDToTypeID( "setd" );
    var desc13 = new ActionDescriptor();
    var idnull = charIDToTypeID( "null" );
        var ref11 = new ActionReference();
        var idPrpr = charIDToTypeID( "Prpr" );
        var idwarp = stringIDToTypeID( "warp" );
        ref11.putProperty( idPrpr, idwarp );
        var idTxLr = charIDToTypeID( "TxLr" );
        var idOrdn = charIDToTypeID( "Ordn" );
        var idTrgt = charIDToTypeID( "Trgt" );
        ref11.putEnumerated( idTxLr, idOrdn, idTrgt );
    desc13.putReference( idnull, ref11 );
    var idT = charIDToTypeID( "T   " );
        var desc14 = new ActionDescriptor();
        var idwarpStyle = stringIDToTypeID( "warpStyle" );
        var idwarpStyle = stringIDToTypeID( "warpStyle" );
        var idwarpBulge = stringIDToTypeID( "warpBulge" );
        desc14.putEnumerated( idwarpStyle, idwarpStyle, idwarpBulge );
        var idwarpValue = stringIDToTypeID( "warpValue" );
        desc14.putDouble( idwarpValue, 14.000000 );
        var idwarpPerspective = stringIDToTypeID( "warpPerspective" );
        desc14.putDouble( idwarpPerspective, -3.000000 );
        var idwarpPerspectiveOther = stringIDToTypeID( "warpPerspectiveOther" );
        desc14.putDouble( idwarpPerspectiveOther, 0.000000 );
        var idwarpRotate = stringIDToTypeID( "warpRotate" );
        var idOrnt = charIDToTypeID( "Ornt" );
        var idHrzn = charIDToTypeID( "Hrzn" );
        desc14.putEnumerated( idwarpRotate, idOrnt, idHrzn );
    var idwarp = stringIDToTypeID( "warp" );
    desc13.putObject( idT, idwarp, desc14 );
executeAction( idsetd, desc13, DialogModes.NO );
    
      var desc1 = new ActionDescriptor();
    var ref1 = new ActionReference();
    ref1.putProperty(app.charIDToTypeID('Prpr'), app.charIDToTypeID('Lefx'));
    ref1.putEnumerated(app.charIDToTypeID('Lyr '), app.charIDToTypeID('Ordn'), app.charIDToTypeID('Trgt'));
    desc1.putReference(app.charIDToTypeID('null'), ref1);
    var desc2 = new ActionDescriptor();
    desc2.putUnitDouble(app.charIDToTypeID('Scl '), app.charIDToTypeID('#Prc'), 416.666666666667);
    var desc3 = new ActionDescriptor();
    desc3.putBoolean(app.charIDToTypeID('enab'), true);
    desc3.putEnumerated(app.charIDToTypeID('Md  '), app.charIDToTypeID('BlnM'), app.charIDToTypeID('Mltp'));
    var desc4 = new ActionDescriptor();
    desc4.putDouble(app.charIDToTypeID('Rd  '), 0.25491042004433);
    desc4.putDouble(app.charIDToTypeID('Grn '), 0.49151558952872);
    desc4.putDouble(app.charIDToTypeID('Bl  '), 0.50261559546925);
    desc3.putObject(app.charIDToTypeID('Clr '), app.stringIDToTypeID("RGBColor"), desc4);
    desc3.putUnitDouble(app.charIDToTypeID('Opct'), app.charIDToTypeID('#Prc'), 100);
    desc3.putBoolean(app.charIDToTypeID('uglg'), false);
    desc3.putUnitDouble(app.charIDToTypeID('lagl'), app.charIDToTypeID('#Ang'), 135);
    desc3.putUnitDouble(app.charIDToTypeID('Dstn'), app.charIDToTypeID('#Pxl'), 7);
    desc3.putUnitDouble(app.charIDToTypeID('Ckmt'), app.charIDToTypeID('#Pxl'), 100);
    desc3.putUnitDouble(app.charIDToTypeID('blur'), app.charIDToTypeID('#Pxl'), 10);
    desc3.putUnitDouble(app.charIDToTypeID('Nose'), app.charIDToTypeID('#Prc'), 0);
    desc3.putBoolean(app.charIDToTypeID('AntA'), false);
    var desc5 = new ActionDescriptor();
    desc5.putString(app.charIDToTypeID('Nm  '), "$$$/Contours/Defaults/Linear=Linear");
    desc3.putObject(app.charIDToTypeID('TrnS'), app.charIDToTypeID('ShpC'), desc5);
    desc3.putBoolean(app.stringIDToTypeID("layerConceals"), true);
    desc2.putObject(app.charIDToTypeID('DrSh'), app.charIDToTypeID('DrSh'), desc3);
    var desc6 = new ActionDescriptor();
    desc6.putBoolean(app.charIDToTypeID('enab'), true);
    desc6.putEnumerated(app.charIDToTypeID('Md  '), app.charIDToTypeID('BlnM'), app.charIDToTypeID('Nrml'));
    desc6.putUnitDouble(app.charIDToTypeID('Opct'), app.charIDToTypeID('#Prc'), 100);
    var desc7 = new ActionDescriptor();
    desc7.putString(app.charIDToTypeID('Nm  '), "$$$/DefaultGradient/OrangeYellowOrange=Orange, Yellow, Orange");
    desc7.putEnumerated(app.charIDToTypeID('GrdF'), app.charIDToTypeID('GrdF'), app.charIDToTypeID('CstS'));
    desc7.putDouble(app.charIDToTypeID('Intr'), 4096);
    var list1 = new ActionList();
    var desc8 = new ActionDescriptor();
    var desc9 = new ActionDescriptor();
    desc9.putDouble(app.charIDToTypeID('Rd  '), 255);
    desc9.putDouble(app.charIDToTypeID('Grn '), 110.264588445425);
    desc9.putDouble(app.charIDToTypeID('Bl  '), 1.99999988079071);
    desc8.putObject(app.charIDToTypeID('Clr '), app.stringIDToTypeID("RGBColor"), desc9);
    desc8.putEnumerated(app.charIDToTypeID('Type'), app.charIDToTypeID('Clry'), app.charIDToTypeID('UsrS'));
    desc8.putInteger(app.charIDToTypeID('Lctn'), 0);
    desc8.putInteger(app.charIDToTypeID('Mdpn'), 50);
    list1.putObject(app.charIDToTypeID('Clrt'), desc8);
    var desc10 = new ActionDescriptor();
    var desc11 = new ActionDescriptor();
    desc11.putDouble(app.charIDToTypeID('Rd  '), 255);
    desc11.putDouble(app.charIDToTypeID('Grn '), 254.988327026367);
    desc11.putDouble(app.charIDToTypeID('Bl  '), 0);
    desc10.putObject(app.charIDToTypeID('Clr '), app.stringIDToTypeID("RGBColor"), desc11);
    desc10.putEnumerated(app.charIDToTypeID('Type'), app.charIDToTypeID('Clry'), app.charIDToTypeID('UsrS'));
    desc10.putInteger(app.charIDToTypeID('Lctn'), 2048);
    desc10.putInteger(app.charIDToTypeID('Mdpn'), 50);
    list1.putObject(app.charIDToTypeID('Clrt'), desc10);
    var desc12 = new ActionDescriptor();
    var desc13 = new ActionDescriptor();
    desc13.putDouble(app.charIDToTypeID('Rd  '), 255);
    desc13.putDouble(app.charIDToTypeID('Grn '), 109.120621830225);
    desc13.putDouble(app.charIDToTypeID('Bl  '), 0);
    desc12.putObject(app.charIDToTypeID('Clr '), app.stringIDToTypeID("RGBColor"), desc13);
    desc12.putEnumerated(app.charIDToTypeID('Type'), app.charIDToTypeID('Clry'), app.charIDToTypeID('UsrS'));
    desc12.putInteger(app.charIDToTypeID('Lctn'), 4096);
    desc12.putInteger(app.charIDToTypeID('Mdpn'), 47);
    list1.putObject(app.charIDToTypeID('Clrt'), desc12);
    desc7.putList(app.charIDToTypeID('Clrs'), list1);
    var list2 = new ActionList();
    var desc14 = new ActionDescriptor();
    desc14.putUnitDouble(app.charIDToTypeID('Opct'), app.charIDToTypeID('#Prc'), 100);
    desc14.putInteger(app.charIDToTypeID('Lctn'), 0);
    desc14.putInteger(app.charIDToTypeID('Mdpn'), 50);
    list2.putObject(app.charIDToTypeID('TrnS'), desc14);
    var desc15 = new ActionDescriptor();
    desc15.putUnitDouble(app.charIDToTypeID('Opct'), app.charIDToTypeID('#Prc'), 100);
    desc15.putInteger(app.charIDToTypeID('Lctn'), 4096);
    desc15.putInteger(app.charIDToTypeID('Mdpn'), 50);
    list2.putObject(app.charIDToTypeID('TrnS'), desc15);
    desc7.putList(app.charIDToTypeID('Trns'), list2);
    desc6.putObject(app.charIDToTypeID('Grad'), app.charIDToTypeID('Grdn'), desc7);
    desc6.putUnitDouble(app.charIDToTypeID('Angl'), app.charIDToTypeID('#Ang'), 90);
    desc6.putEnumerated(app.charIDToTypeID('Type'), app.charIDToTypeID('GrdT'), app.charIDToTypeID('Lnr '));
    desc6.putBoolean(app.charIDToTypeID('Rvrs'), false);
    desc6.putBoolean(app.charIDToTypeID('Dthr'), false);
    desc6.putBoolean(app.charIDToTypeID('Algn'), true);
    desc6.putUnitDouble(app.charIDToTypeID('Scl '), app.charIDToTypeID('#Prc'), 100);
    var desc16 = new ActionDescriptor();
    desc16.putUnitDouble(app.charIDToTypeID('Hrzn'), app.charIDToTypeID('#Prc'), 0);
    desc16.putUnitDouble(app.charIDToTypeID('Vrtc'), app.charIDToTypeID('#Prc'), 0);
    desc6.putObject(app.charIDToTypeID('Ofst'), app.charIDToTypeID('Pnt '), desc16);
    desc2.putObject(app.charIDToTypeID('GrFl'), app.charIDToTypeID('GrFl'), desc6);
    var desc17 = new ActionDescriptor();
    desc17.putBoolean(app.charIDToTypeID('enab'), true);
    desc17.putEnumerated(app.charIDToTypeID('Styl'), app.charIDToTypeID('FStl'), app.charIDToTypeID('OutF'));
    desc17.putEnumerated(app.charIDToTypeID('PntT'), app.charIDToTypeID('FrFl'), app.charIDToTypeID('SClr'));
    desc17.putEnumerated(app.charIDToTypeID('Md  '), app.charIDToTypeID('BlnM'), app.charIDToTypeID('Nrml'));
    desc17.putUnitDouble(app.charIDToTypeID('Opct'), app.charIDToTypeID('#Prc'), 100);
    desc17.putUnitDouble(app.charIDToTypeID('Sz  '), app.charIDToTypeID('#Pxl'), 8);
    var desc18 = new ActionDescriptor();
    desc18.putDouble(app.charIDToTypeID('Rd  '), 0.25491042004433);
    desc18.putDouble(app.charIDToTypeID('Grn '), 0.49151558952872);
    desc18.putDouble(app.charIDToTypeID('Bl  '), 0.50261559546925);
    desc17.putObject(app.charIDToTypeID('Clr '), app.stringIDToTypeID("RGBColor"), desc18);
    desc2.putObject(app.charIDToTypeID('FrFX'), app.charIDToTypeID('FrFX'), desc17);
    desc1.putObject(app.charIDToTypeID('T   '), app.charIDToTypeID('Lefx'), desc2);
    executeAction(app.charIDToTypeID('setd'), desc1, dialogMode);
    
   
    
    var textLayer = docRef.activeLayer;
    
    //align, rotate and center group
       var newSet = textLayer.parent.layerSets.add();
   newSet.name = shapeLayerName;
   this.setLayerGreen();
    bottomShapeLayer.name = "Bottom Splash";
    topShapeLayer.name = "Top Splash";
    
        bottomShapeLayer.move(newSet,ElementPlacement.INSIDE);
         topShapeLayer.move(newSet,ElementPlacement.INSIDE);
          
          textLayer.move(newSet,ElementPlacement.INSIDE);
          
          //center all to image center
          this.centerLayerToDoc(bottomShapeLayer,docRef);
          this.centerLayerToDoc(topShapeLayer,docRef);
          this.centerLayerToDoc(textLayer,docRef);
          //move text to bottom
          
          
          newSet.rotate(-15);
          
		break;
        
        
		
    	case "frames":
    	  if(!app.documents.length) return;
         var docRef = app.activeDocument;
            
         var  whiteLayerRef = docRef.artLayers.add();
          var desc1 = new ActionDescriptor();
    desc1.putEnumerated(app.charIDToTypeID('Usng'), app.charIDToTypeID('FlCn'), app.charIDToTypeID('Wht '));
    desc1.putUnitDouble(app.charIDToTypeID('Opct'), app.charIDToTypeID('#Prc'), 100);
    desc1.putEnumerated(app.charIDToTypeID('Md  '), app.charIDToTypeID('BlnM'), app.charIDToTypeID('Nrml'));
    executeAction(app.charIDToTypeID('Fl  '), desc1, dialogMode);
    
         whiteLayerRef.blendMode = BlendMode.MULTIPLY;
         whiteLayerRef.name = "Black Frame";
         this.setLayerRed();
         
         var desc1 = new ActionDescriptor();
    var ref1 = new ActionReference();
    ref1.putProperty(app.charIDToTypeID('Prpr'), app.charIDToTypeID('Lefx'));
    ref1.putEnumerated(app.charIDToTypeID('Lyr '), app.charIDToTypeID('Ordn'), app.charIDToTypeID('Trgt'));
    desc1.putReference(app.charIDToTypeID('null'), ref1);
    var desc2 = new ActionDescriptor();
    desc2.putUnitDouble(app.charIDToTypeID('Scl '), app.charIDToTypeID('#Prc'), docRef.resolution/72);
    var desc3 = new ActionDescriptor();
    desc3.putBoolean(app.charIDToTypeID('enab'), true);
    desc3.putEnumerated(app.charIDToTypeID('Styl'), app.charIDToTypeID('FStl'), app.charIDToTypeID('InsF'));
    desc3.putEnumerated(app.charIDToTypeID('PntT'), app.charIDToTypeID('FrFl'), app.charIDToTypeID('SClr'));
    desc3.putEnumerated(app.charIDToTypeID('Md  '), app.charIDToTypeID('BlnM'), app.charIDToTypeID('Nrml'));
    desc3.putUnitDouble(app.charIDToTypeID('Opct'), app.charIDToTypeID('#Prc'), 100);
    desc3.putUnitDouble(app.charIDToTypeID('Sz  '), app.charIDToTypeID('#Pxl'), 48);
    var desc4 = new ActionDescriptor();
    desc4.putDouble(app.charIDToTypeID('Rd  '), 0);
    desc4.putDouble(app.charIDToTypeID('Grn '), 0);
    desc4.putDouble(app.charIDToTypeID('Bl  '), 0);
    desc3.putObject(app.charIDToTypeID('Clr '), app.stringIDToTypeID("RGBColor"), desc4);
    desc2.putObject(app.charIDToTypeID('FrFX'), app.charIDToTypeID('FrFX'), desc3);
    desc1.putObject(app.charIDToTypeID('T   '), app.charIDToTypeID('Lefx'), desc2);
    executeAction(app.charIDToTypeID('setd'), desc1, dialogMode);
         
         var  blackLayerRef = docRef.artLayers.add();
         blackLayerRef.blendMode = BlendMode.MULTIPLY;
         blackLayerRef.name = "White Frame";
         this.setLayerRed();
             var desc1 = new ActionDescriptor();
    desc1.putEnumerated(app.charIDToTypeID('Usng'), app.charIDToTypeID('FlCn'), app.charIDToTypeID('Wht '));
    desc1.putUnitDouble(app.charIDToTypeID('Opct'), app.charIDToTypeID('#Prc'), 100);
    desc1.putEnumerated(app.charIDToTypeID('Md  '), app.charIDToTypeID('BlnM'), app.charIDToTypeID('Nrml'));
    executeAction(app.charIDToTypeID('Fl  '), desc1, dialogMode);
         
          var desc1 = new ActionDescriptor();
    var ref1 = new ActionReference();
    ref1.putProperty(app.charIDToTypeID('Prpr'), app.charIDToTypeID('Lefx'));
    ref1.putEnumerated(app.charIDToTypeID('Lyr '), app.charIDToTypeID('Ordn'), app.charIDToTypeID('Trgt'));
    desc1.putReference(app.charIDToTypeID('null'), ref1);
    var desc2 = new ActionDescriptor();
    desc2.putUnitDouble(app.charIDToTypeID('Scl '), app.charIDToTypeID('#Prc'), docRef.resolution/72);
    var desc3 = new ActionDescriptor();
    desc3.putBoolean(app.charIDToTypeID('enab'), true);
    desc3.putEnumerated(app.charIDToTypeID('Styl'), app.charIDToTypeID('FStl'), app.charIDToTypeID('InsF'));
    desc3.putEnumerated(app.charIDToTypeID('PntT'), app.charIDToTypeID('FrFl'), app.charIDToTypeID('SClr'));
    desc3.putEnumerated(app.charIDToTypeID('Md  '), app.charIDToTypeID('BlnM'), app.charIDToTypeID('Nrml'));
    desc3.putUnitDouble(app.charIDToTypeID('Opct'), app.charIDToTypeID('#Prc'), 100);
    desc3.putUnitDouble(app.charIDToTypeID('Sz  '), app.charIDToTypeID('#Pxl'), 40);
    var desc4 = new ActionDescriptor();
    desc4.putDouble(app.charIDToTypeID('Rd  '), 255);
    desc4.putDouble(app.charIDToTypeID('Grn '), 255);
    desc4.putDouble(app.charIDToTypeID('Bl  '), 255);
    desc3.putObject(app.charIDToTypeID('Clr '), app.stringIDToTypeID("RGBColor"), desc4);
    desc2.putObject(app.charIDToTypeID('FrFX'), app.charIDToTypeID('FrFX'), desc3);
    desc1.putObject(app.charIDToTypeID('T   '), app.charIDToTypeID('Lefx'), desc2);
    executeAction(app.charIDToTypeID('setd'), desc1, dialogMode);
    break;
    
    
    case "header":
     if(!app.documents.length) return;
         var docRef = app.activeDocument;
         
       
    var desc1 = new ActionDescriptor();
    var ref1 = new ActionReference();
    ref1.putClass(app.stringIDToTypeID("contentLayer"));
    desc1.putReference(app.charIDToTypeID('null'), ref1);
    var desc2 = new ActionDescriptor();
    var desc3 = new ActionDescriptor();
    desc3.putBoolean(app.charIDToTypeID('Dthr'), true);
    desc3.putEnumerated(app.charIDToTypeID('Type'), app.charIDToTypeID('GrdT'), app.charIDToTypeID('Lnr '));
    var desc4 = new ActionDescriptor();
    desc4.putString(app.charIDToTypeID('Nm  '), "Custom");
    desc4.putEnumerated(app.charIDToTypeID('GrdF'), app.charIDToTypeID('GrdF'), app.charIDToTypeID('CstS'));
    desc4.putDouble(app.charIDToTypeID('Intr'), 4096);
    var list1 = new ActionList();
    var desc5 = new ActionDescriptor();
    var desc6 = new ActionDescriptor();
    desc6.putDouble(app.charIDToTypeID('Rd  '), 255);
    desc6.putDouble(app.charIDToTypeID('Grn '), 125.68871319294);
    desc6.putDouble(app.charIDToTypeID('Bl  '), 29.0000001713634);
    desc5.putObject(app.charIDToTypeID('Clr '), app.stringIDToTypeID("RGBColor"), desc6);
    desc5.putEnumerated(app.charIDToTypeID('Type'), app.charIDToTypeID('Clry'), app.charIDToTypeID('UsrS'));
    desc5.putInteger(app.charIDToTypeID('Lctn'), 2409);
    desc5.putInteger(app.charIDToTypeID('Mdpn'), 50);
    list1.putObject(app.charIDToTypeID('Clrt'), desc5);
    var desc7 = new ActionDescriptor();
    var desc8 = new ActionDescriptor();
    desc8.putDouble(app.charIDToTypeID('Rd  '), 255);
    desc8.putDouble(app.charIDToTypeID('Grn '), 254.988327026367);
    desc8.putDouble(app.charIDToTypeID('Bl  '), 0);
    desc7.putObject(app.charIDToTypeID('Clr '), app.stringIDToTypeID("RGBColor"), desc8);
    desc7.putEnumerated(app.charIDToTypeID('Type'), app.charIDToTypeID('Clry'), app.charIDToTypeID('UsrS'));
    desc7.putInteger(app.charIDToTypeID('Lctn'), 4096);
    desc7.putInteger(app.charIDToTypeID('Mdpn'), 50);
    list1.putObject(app.charIDToTypeID('Clrt'), desc7);
    desc4.putList(app.charIDToTypeID('Clrs'), list1);
    var list2 = new ActionList();
    var desc9 = new ActionDescriptor();
    desc9.putUnitDouble(app.charIDToTypeID('Opct'), app.charIDToTypeID('#Prc'), 100);
    desc9.putInteger(app.charIDToTypeID('Lctn'), 0);
    desc9.putInteger(app.charIDToTypeID('Mdpn'), 50);
    list2.putObject(app.charIDToTypeID('TrnS'), desc9);
    var desc10 = new ActionDescriptor();
    desc10.putUnitDouble(app.charIDToTypeID('Opct'), app.charIDToTypeID('#Prc'), 100);
    desc10.putInteger(app.charIDToTypeID('Lctn'), 4096);
    desc10.putInteger(app.charIDToTypeID('Mdpn'), 50);
    list2.putObject(app.charIDToTypeID('TrnS'), desc10);
    desc4.putList(app.charIDToTypeID('Trns'), list2);
    desc3.putObject(app.charIDToTypeID('Grad'), app.charIDToTypeID('Grdn'), desc4);
    desc2.putObject(app.charIDToTypeID('Type'), app.stringIDToTypeID("gradientLayer"), desc3);
    var desc11 = new ActionDescriptor();
    desc11.putInteger(app.stringIDToTypeID("unitValueQuadVersion"), 1);
    desc11.putUnitDouble(app.charIDToTypeID('Top '), app.charIDToTypeID('#Pxl'), 341);
    desc11.putUnitDouble(app.charIDToTypeID('Left'), app.charIDToTypeID('#Pxl'), 270);
    desc11.putUnitDouble(app.charIDToTypeID('Btom'), app.charIDToTypeID('#Pxl'), 521);
    desc11.putUnitDouble(app.charIDToTypeID('Rght'), app.charIDToTypeID('#Pxl'), 1492);
    desc11.putUnitDouble(app.stringIDToTypeID("topRight"), app.charIDToTypeID('#Pxl'), -1);
    desc11.putUnitDouble(app.stringIDToTypeID("topLeft"), app.charIDToTypeID('#Pxl'), -1);
    desc11.putUnitDouble(app.stringIDToTypeID("bottomLeft"), app.charIDToTypeID('#Pxl'), -1);
    desc11.putUnitDouble(app.stringIDToTypeID("bottomRight"), app.charIDToTypeID('#Pxl'), -1);
    desc2.putObject(app.charIDToTypeID('Shp '), app.charIDToTypeID('Rctn'), desc11);
    desc1.putObject(app.charIDToTypeID('Usng'), app.stringIDToTypeID("contentLayer"), desc2);
    executeAction(app.charIDToTypeID('Mk  '), desc1, dialogMode);
    

   //set style
    var idsetd = charIDToTypeID( "setd" );
    var desc20 = new ActionDescriptor();
    var idnull = charIDToTypeID( "null" );
        var ref15 = new ActionReference();
        var idPrpr = charIDToTypeID( "Prpr" );
        var idLefx = charIDToTypeID( "Lefx" );
        ref15.putProperty( idPrpr, idLefx );
        var idLyr = charIDToTypeID( "Lyr " );
        var idOrdn = charIDToTypeID( "Ordn" );
        var idTrgt = charIDToTypeID( "Trgt" );
        ref15.putEnumerated( idLyr, idOrdn, idTrgt );
    desc20.putReference( idnull, ref15 );
    var idT = charIDToTypeID( "T   " );
        var desc21 = new ActionDescriptor();
        var idScl = charIDToTypeID( "Scl " );
        var idPrc = charIDToTypeID( "#Prc" );
        desc21.putUnitDouble( idScl, idPrc, docRef.resolution/72 );
     
        var idFrFX = charIDToTypeID( "FrFX" );
            var desc29 = new ActionDescriptor();
            var idenab = charIDToTypeID( "enab" );
            desc29.putBoolean( idenab, true );
            var idStyl = charIDToTypeID( "Styl" );
            var idFStl = charIDToTypeID( "FStl" );
            var idOutF = charIDToTypeID( "InsF" );
            desc29.putEnumerated( idStyl, idFStl, idOutF );
            var idPntT = charIDToTypeID( "PntT" );
            var idFrFl = charIDToTypeID( "FrFl" );
            var idSClr = charIDToTypeID( "SClr" );
            desc29.putEnumerated( idPntT, idFrFl, idSClr );
            var idMd = charIDToTypeID( "Md  " );
            var idBlnM = charIDToTypeID( "BlnM" );
            var idNrml = charIDToTypeID( "Nrml" );
            desc29.putEnumerated( idMd, idBlnM, idNrml );
            var idOpct = charIDToTypeID( "Opct" );
            var idPrc = charIDToTypeID( "#Prc" );
            desc29.putUnitDouble( idOpct, idPrc, 100.000000 );
            var idSz = charIDToTypeID( "Sz  " );
            var idPxl = charIDToTypeID( "#Pxl" );
            desc29.putUnitDouble( idSz, idPxl, 6.000000 );
            var idClr = charIDToTypeID( "Clr " );
                var desc30 = new ActionDescriptor();
                var idRd = charIDToTypeID( "Rd  " );
                desc30.putDouble( idRd, 0.254910 );
                var idGrn = charIDToTypeID( "Grn " );
                desc30.putDouble( idGrn, 0.491516 );
                var idBl = charIDToTypeID( "Bl  " );
                desc30.putDouble( idBl, 0.502616 );
            var idRGBC = charIDToTypeID( "RGBC" );
            desc29.putObject( idClr, idRGBC, desc30 );
        var idFrFX = charIDToTypeID( "FrFX" );
        desc21.putObject( idFrFX, idFrFX, desc29 );
    var idLefx = charIDToTypeID( "Lefx" );
    desc20.putObject( idT, idLefx, desc21 );
executeAction( idsetd, desc20, DialogModes.NO );
    
    //make blue
    //setLayerBlue();
    
    //align centers of layer and doc
    var shapeLayer = docRef.activeLayer;
    shapeLayer.name = "Header";
    this.centerLayerToDoc(shapeLayer,docRef);


//text1

    var desc1 = new ActionDescriptor();
    var ref1 = new ActionReference();
    ref1.putClass(app.charIDToTypeID('TxLr'));
    desc1.putReference(app.charIDToTypeID('null'), ref1);
    var desc2 = new ActionDescriptor();
    desc2.putString(app.charIDToTypeID('Txt '), "EPTEMBER 28, 2075");
    var desc3 = new ActionDescriptor();
    desc3.putEnumerated(app.stringIDToTypeID("warpStyle"), app.stringIDToTypeID("warpStyle"), app.stringIDToTypeID("warpNone"));
    desc3.putDouble(app.stringIDToTypeID("warpValue"), 0);
    desc3.putDouble(app.stringIDToTypeID("warpPerspective"), 0);
    desc3.putDouble(app.stringIDToTypeID("warpPerspectiveOther"), 0);
    desc3.putEnumerated(app.stringIDToTypeID("warpRotate"), app.charIDToTypeID('Ornt'), app.charIDToTypeID('Hrzn'));
    desc2.putObject(app.charIDToTypeID('warp'), app.charIDToTypeID('warp'), desc3);
    var desc4 = new ActionDescriptor();
    desc4.putUnitDouble(app.charIDToTypeID('Hrzn'), app.charIDToTypeID('#Prc'), 12.2881355932203);
    desc4.putUnitDouble(app.charIDToTypeID('Vrtc'), app.charIDToTypeID('#Prc'), 23.7623762376238);
    desc2.putObject(app.charIDToTypeID('TxtC'), app.charIDToTypeID('Pnt '), desc4);
    desc2.putEnumerated(app.stringIDToTypeID("textGridding"), app.stringIDToTypeID("textGridding"), app.charIDToTypeID('None'));
    desc2.putEnumerated(app.charIDToTypeID('Ornt'), app.charIDToTypeID('Ornt'), app.charIDToTypeID('Hrzn'));
    desc2.putEnumerated(app.charIDToTypeID('AntA'), app.charIDToTypeID('Annt'), app.charIDToTypeID('AnSm'));
    var desc5 = new ActionDescriptor();
    desc5.putUnitDouble(app.charIDToTypeID('Left'), app.charIDToTypeID('#Pxl'), 0);
    desc5.putUnitDouble(app.charIDToTypeID('Top '), app.charIDToTypeID('#Pxl'), -6.89483642578125);
    desc5.putUnitDouble(app.charIDToTypeID('Rght'), app.charIDToTypeID('#Pxl'), 783.122863769531);
    desc5.putUnitDouble(app.charIDToTypeID('Btom'), app.charIDToTypeID('#Pxl'), 109.839996337891);
    desc2.putObject(app.stringIDToTypeID("bounds"), app.stringIDToTypeID("bounds"), desc5);
    var desc6 = new ActionDescriptor();
    desc6.putUnitDouble(app.charIDToTypeID('Left'), app.charIDToTypeID('#Pxl'), 4.421875);
    desc6.putUnitDouble(app.charIDToTypeID('Top '), app.charIDToTypeID('#Pxl'), -1.09600830078125);
    desc6.putUnitDouble(app.charIDToTypeID('Rght'), app.charIDToTypeID('#Pxl'), 698.666015625);
    desc6.putUnitDouble(app.charIDToTypeID('Btom'), app.charIDToTypeID('#Pxl'), 63.9039916992188);
    desc2.putObject(app.stringIDToTypeID("boundingBox"), app.stringIDToTypeID("boundingBox"), desc6);
    var list1 = new ActionList();
    var desc7 = new ActionDescriptor();
    desc7.putEnumerated(app.stringIDToTypeID("textType"), app.stringIDToTypeID("textType"), app.stringIDToTypeID("box"));
    desc7.putEnumerated(app.charIDToTypeID('Ornt'), app.charIDToTypeID('Ornt'), app.charIDToTypeID('Hrzn'));
    var desc8 = new ActionDescriptor();
    desc8.putDouble(app.stringIDToTypeID("xx"), 1);
    desc8.putDouble(app.stringIDToTypeID("xy"), 0);
    desc8.putDouble(app.stringIDToTypeID("yx"), 0);
    desc8.putDouble(app.stringIDToTypeID("yy"), 1);
    desc8.putDouble(app.stringIDToTypeID("tx"), 0);
    desc8.putDouble(app.stringIDToTypeID("ty"), 0);
    desc7.putObject(app.charIDToTypeID('Trnf'), app.charIDToTypeID('Trnf'), desc8);
    desc7.putInteger(app.stringIDToTypeID("rowCount"), 1);
    desc7.putInteger(app.stringIDToTypeID("columnCount"), 1);
    desc7.putBoolean(app.stringIDToTypeID("rowMajorOrder"), true);
    desc7.putUnitDouble(app.stringIDToTypeID("rowGutter"), app.charIDToTypeID('#Pxl'), 0);
    desc7.putUnitDouble(app.stringIDToTypeID("columnGutter"), app.charIDToTypeID('#Pxl'), 0);
    desc7.putUnitDouble(app.charIDToTypeID('Spcn'), app.charIDToTypeID('#Pxl'), 0);
    desc7.putEnumerated(app.stringIDToTypeID("frameBaselineAlignment"), app.stringIDToTypeID("frameBaselineAlignment"), app.stringIDToTypeID("alignByAscent"));
    desc7.putUnitDouble(app.stringIDToTypeID("firstBaselineMinimum"), app.charIDToTypeID('#Pxl'), 0);
    var desc9 = new ActionDescriptor();
    desc9.putDouble(app.charIDToTypeID('Top '), 0);
    desc9.putDouble(app.charIDToTypeID('Left'), 0);
    desc9.putDouble(app.charIDToTypeID('Btom'), 109.839996337891);
    desc9.putDouble(app.charIDToTypeID('Rght'), 783.122863769531);
    desc7.putObject(app.stringIDToTypeID("bounds"), app.charIDToTypeID('Rctn'), desc9);
    list1.putObject(app.stringIDToTypeID("textShape"), desc7);
    desc2.putList(app.stringIDToTypeID("textShape"), list1);
    var list2 = new ActionList();
    var desc10 = new ActionDescriptor();
    desc10.putInteger(app.charIDToTypeID('From'), 0);
    desc10.putInteger(app.charIDToTypeID('T   '), 18);
    var desc11 = new ActionDescriptor();
    desc11.putBoolean(app.stringIDToTypeID("styleSheetHasParent"), true);
    desc11.putString(app.stringIDToTypeID("fontPostScriptName"), "ComicSansMS");
    desc11.putString(app.charIDToTypeID('FntN'), "Comic Sans MS");
    desc11.putString(app.charIDToTypeID('FntS'), "Bold Italic");
    desc11.putInteger(app.charIDToTypeID('Scrp'), 0);
    desc11.putInteger(app.charIDToTypeID('FntT'), 1);
    desc11.putUnitDouble(app.charIDToTypeID('Sz  '), app.charIDToTypeID('#Pxl'), 86);
    desc11.putDouble(app.charIDToTypeID('HrzS'), 100);
    desc11.putDouble(app.charIDToTypeID('VrtS'), 100);
    desc11.putBoolean(app.stringIDToTypeID("syntheticBold"), false);
    desc11.putBoolean(app.stringIDToTypeID("syntheticItalic"), false);
    desc11.putBoolean(app.stringIDToTypeID("autoLeading"), true);
    desc11.putInteger(app.charIDToTypeID('Trck'), 0);
    desc11.putUnitDouble(app.charIDToTypeID('Bsln'), app.charIDToTypeID('#Pxl'), 0);
    desc11.putEnumerated(app.charIDToTypeID('AtKr'), app.charIDToTypeID('AtKr'), app.stringIDToTypeID("metricsKern"));
    desc11.putEnumerated(app.stringIDToTypeID("fontCaps"), app.stringIDToTypeID("fontCaps"), app.charIDToTypeID('Nrml'));
    desc11.putEnumerated(app.stringIDToTypeID("digitSet"), app.stringIDToTypeID("digitSet"), app.stringIDToTypeID("defaultDigits"));
    desc11.putEnumerated(app.stringIDToTypeID("kashidas"), app.stringIDToTypeID("kashidas"), app.stringIDToTypeID("kashidaDefault"));
    desc11.putUnitDouble(app.stringIDToTypeID("diacXOffset"), app.charIDToTypeID('#Pxl'), 0);
    desc11.putUnitDouble(app.stringIDToTypeID("diacYOffset"), app.charIDToTypeID('#Pxl'), 0);
    desc11.putUnitDouble(app.stringIDToTypeID("markYDistFromBaseline"), app.charIDToTypeID('#Pxl'), 1.38240003585815);
    desc11.putEnumerated(app.stringIDToTypeID("baseline"), app.stringIDToTypeID("baseline"), app.charIDToTypeID('Nrml'));
    desc11.putEnumerated(app.stringIDToTypeID("strikethrough"), app.stringIDToTypeID("strikethrough"), app.stringIDToTypeID("strikethroughOff"));
    desc11.putEnumerated(app.charIDToTypeID('Undl'), app.charIDToTypeID('Undl'), app.stringIDToTypeID("underlineOff"));
    desc11.putBoolean(app.stringIDToTypeID("ligature"), true);
    desc11.putBoolean(app.stringIDToTypeID("altligature"), false);
    desc11.putBoolean(app.stringIDToTypeID("contextualLigatures"), false);
    desc11.putBoolean(app.stringIDToTypeID("fractions"), false);
    desc11.putBoolean(app.stringIDToTypeID("ordinals"), false);
    desc11.putBoolean(app.stringIDToTypeID("swash"), false);
    desc11.putBoolean(app.stringIDToTypeID("titling"), false);
    desc11.putBoolean(app.stringIDToTypeID("connectionForms"), false);
    desc11.putBoolean(app.stringIDToTypeID("stylisticAlternates"), false);
    desc11.putBoolean(app.stringIDToTypeID("ornaments"), false);
    desc11.putBoolean(app.stringIDToTypeID("justificationAlternates"), false);
    desc11.putEnumerated(app.stringIDToTypeID("figureStyle"), app.stringIDToTypeID("figureStyle"), app.charIDToTypeID('Nrml'));
    desc11.putBoolean(app.stringIDToTypeID("proportionalMetrics"), false);
    desc11.putBoolean(app.charIDToTypeID('kana'), false);
    desc11.putBoolean(app.stringIDToTypeID("italics"), false);
    desc11.putEnumerated(app.stringIDToTypeID("baselineDirection"), app.stringIDToTypeID("baselineDirection"), app.stringIDToTypeID("withStream"));
    desc11.putEnumerated(app.stringIDToTypeID("textLanguage"), app.stringIDToTypeID("textLanguage"), app.stringIDToTypeID("englishLanguage"));
    desc11.putEnumerated(app.stringIDToTypeID("japaneseAlternate"), app.stringIDToTypeID("japaneseAlternate"), app.stringIDToTypeID("defaultForm"));
    desc11.putDouble(app.stringIDToTypeID("mojiZume"), 0);
    desc11.putEnumerated(app.stringIDToTypeID("gridAlignment"), app.stringIDToTypeID("gridAlignment"), app.stringIDToTypeID("roman"));
    desc11.putBoolean(app.stringIDToTypeID("noBreak"), false);
    var desc12 = new ActionDescriptor();
    desc12.putDouble(app.charIDToTypeID('Rd  '), 0);
    desc12.putDouble(app.charIDToTypeID('Grn '), 0);
    desc12.putDouble(app.charIDToTypeID('Bl  '), 0);
    desc11.putObject(app.charIDToTypeID('Clr '), app.stringIDToTypeID("RGBColor"), desc12);
    var desc13 = new ActionDescriptor();
    desc13.putDouble(app.charIDToTypeID('Rd  '), 0);
    desc13.putDouble(app.charIDToTypeID('Grn '), 0);
    desc13.putDouble(app.charIDToTypeID('Bl  '), 0);
    desc11.putObject(app.stringIDToTypeID("strokeColor"), app.stringIDToTypeID("RGBColor"), desc13);
    var desc14 = new ActionDescriptor();
    desc14.putString(app.stringIDToTypeID("fontPostScriptName"), "MyriadPro-Regular");
    desc14.putString(app.charIDToTypeID('FntN'), "Myriad Pro");
    desc14.putString(app.charIDToTypeID('FntS'), "Regular");
    desc14.putInteger(app.charIDToTypeID('Scrp'), 0);
    desc14.putInteger(app.charIDToTypeID('FntT'), 0);
    desc14.putUnitDouble(app.charIDToTypeID('Sz  '), app.charIDToTypeID('#Pxl'), 12);
    desc14.putDouble(app.charIDToTypeID('HrzS'), 100);
    desc14.putDouble(app.charIDToTypeID('VrtS'), 100);
    desc14.putBoolean(app.stringIDToTypeID("syntheticBold"), false);
    desc14.putBoolean(app.stringIDToTypeID("syntheticItalic"), false);
    desc14.putBoolean(app.stringIDToTypeID("autoLeading"), true);
    desc14.putInteger(app.charIDToTypeID('Trck'), 0);
    desc14.putUnitDouble(app.charIDToTypeID('Bsln'), app.charIDToTypeID('#Pxl'), 0);
    desc14.putDouble(app.stringIDToTypeID("characterRotation"), 0);
    desc14.putEnumerated(app.charIDToTypeID('AtKr'), app.charIDToTypeID('AtKr'), app.stringIDToTypeID("metricsKern"));
    desc14.putEnumerated(app.stringIDToTypeID("fontCaps"), app.stringIDToTypeID("fontCaps"), app.charIDToTypeID('Nrml'));
    desc14.putEnumerated(app.stringIDToTypeID("digitSet"), app.stringIDToTypeID("digitSet"), app.stringIDToTypeID("defaultDigits"));
    desc14.putEnumerated(app.stringIDToTypeID("dirOverride"), app.stringIDToTypeID("dirOverride"), app.stringIDToTypeID("dirOverrideDefault"));
    desc14.putEnumerated(app.stringIDToTypeID("kashidas"), app.stringIDToTypeID("kashidas"), app.stringIDToTypeID("kashidaDefault"));
    desc14.putEnumerated(app.stringIDToTypeID("diacVPos"), app.stringIDToTypeID("diacVPos"), app.stringIDToTypeID("diacVPosOpenType"));
    desc14.putUnitDouble(app.stringIDToTypeID("diacXOffset"), app.charIDToTypeID('#Pxl'), 0);
    desc14.putUnitDouble(app.stringIDToTypeID("diacYOffset"), app.charIDToTypeID('#Pxl'), 0);
    desc14.putUnitDouble(app.stringIDToTypeID("markYDistFromBaseline"), app.charIDToTypeID('#Pxl'), 100);
    desc14.putEnumerated(app.stringIDToTypeID("baseline"), app.stringIDToTypeID("baseline"), app.charIDToTypeID('Nrml'));
    desc14.putEnumerated(app.stringIDToTypeID("otbaseline"), app.stringIDToTypeID("otbaseline"), app.charIDToTypeID('Nrml'));
    desc14.putEnumerated(app.stringIDToTypeID("strikethrough"), app.stringIDToTypeID("strikethrough"), app.stringIDToTypeID("strikethroughOff"));
    desc14.putEnumerated(app.charIDToTypeID('Undl'), app.charIDToTypeID('Undl'), app.stringIDToTypeID("underlineOff"));
    desc14.putUnitDouble(app.stringIDToTypeID("underlineOffset"), app.charIDToTypeID('#Pxl'), 0);
    desc14.putBoolean(app.stringIDToTypeID("ligature"), true);
    desc14.putBoolean(app.stringIDToTypeID("altligature"), false);
    desc14.putBoolean(app.stringIDToTypeID("contextualLigatures"), false);
    desc14.putBoolean(app.stringIDToTypeID("alternateLigatures"), false);
    desc14.putBoolean(app.stringIDToTypeID("oldStyle"), false);
    desc14.putBoolean(app.stringIDToTypeID("fractions"), false);
    desc14.putBoolean(app.stringIDToTypeID("ordinals"), false);
    desc14.putBoolean(app.stringIDToTypeID("swash"), false);
    desc14.putBoolean(app.stringIDToTypeID("titling"), false);
    desc14.putBoolean(app.stringIDToTypeID("connectionForms"), false);
    desc14.putBoolean(app.stringIDToTypeID("stylisticAlternates"), false);
    desc14.putBoolean(app.stringIDToTypeID("ornaments"), false);
    desc14.putBoolean(app.stringIDToTypeID("justificationAlternates"), false);
    desc14.putEnumerated(app.stringIDToTypeID("figureStyle"), app.stringIDToTypeID("figureStyle"), app.charIDToTypeID('Nrml'));
    desc14.putBoolean(app.stringIDToTypeID("proportionalMetrics"), false);
    desc14.putBoolean(app.charIDToTypeID('kana'), false);
    desc14.putBoolean(app.stringIDToTypeID("italics"), false);
    desc14.putBoolean(app.charIDToTypeID('ruby'), false);
    desc14.putEnumerated(app.stringIDToTypeID("baselineDirection"), app.stringIDToTypeID("baselineDirection"), app.stringIDToTypeID("rotated"));
    desc14.putEnumerated(app.stringIDToTypeID("textLanguage"), app.stringIDToTypeID("textLanguage"), app.stringIDToTypeID("englishLanguage"));
    desc14.putEnumerated(app.stringIDToTypeID("japaneseAlternate"), app.stringIDToTypeID("japaneseAlternate"), app.stringIDToTypeID("defaultForm"));
    desc14.putDouble(app.stringIDToTypeID("mojiZume"), 0);
    desc14.putEnumerated(app.stringIDToTypeID("gridAlignment"), app.stringIDToTypeID("gridAlignment"), app.stringIDToTypeID("roman"));
    desc14.putBoolean(app.stringIDToTypeID("enableWariChu"), false);
    desc14.putInteger(app.stringIDToTypeID("wariChuCount"), 2);
    desc14.putInteger(app.stringIDToTypeID("wariChuLineGap"), 0);
    desc14.putDouble(app.stringIDToTypeID("wariChuScale"), 0.5);
    desc14.putInteger(app.stringIDToTypeID("wariChuWidow"), 2);
    desc14.putInteger(app.stringIDToTypeID("wariChuOrphan"), 2);
    desc14.putEnumerated(app.stringIDToTypeID("wariChuJustification"), app.stringIDToTypeID("wariChuJustification"), app.stringIDToTypeID("wariChuAutoJustify"));
    desc14.putInteger(app.stringIDToTypeID("tcyUpDown"), 0);
    desc14.putInteger(app.stringIDToTypeID("tcyLeftRight"), 0);
    desc14.putDouble(app.stringIDToTypeID("leftAki"), -1);
    desc14.putDouble(app.stringIDToTypeID("rightAki"), -1);
    desc14.putInteger(app.stringIDToTypeID("jiDori"), 0);
    desc14.putBoolean(app.stringIDToTypeID("noBreak"), false);
    var desc15 = new ActionDescriptor();
    desc15.putDouble(app.charIDToTypeID('Rd  '), 0);
    desc15.putDouble(app.charIDToTypeID('Grn '), 0);
    desc15.putDouble(app.charIDToTypeID('Bl  '), 0);
    desc14.putObject(app.charIDToTypeID('Clr '), app.stringIDToTypeID("RGBColor"), desc15);
    var desc16 = new ActionDescriptor();
    desc16.putDouble(app.charIDToTypeID('Rd  '), 0);
    desc16.putDouble(app.charIDToTypeID('Grn '), 0);
    desc16.putDouble(app.charIDToTypeID('Bl  '), 0);
    desc14.putObject(app.stringIDToTypeID("strokeColor"), app.stringIDToTypeID("RGBColor"), desc16);
    desc14.putBoolean(app.charIDToTypeID('Fl  '), true);
    desc14.putBoolean(app.charIDToTypeID('Strk'), false);
    desc14.putBoolean(app.stringIDToTypeID("fillFirst"), true);
    desc14.putBoolean(app.stringIDToTypeID("fillOverPrint"), false);
    desc14.putBoolean(app.stringIDToTypeID("strokeOverPrint"), false);
    desc14.putEnumerated(app.stringIDToTypeID("lineCap"), app.stringIDToTypeID("lineCap"), app.stringIDToTypeID("buttCap"));
    desc14.putEnumerated(app.stringIDToTypeID("lineJoin"), app.stringIDToTypeID("lineJoin"), app.stringIDToTypeID("miterJoin"));
    desc14.putUnitDouble(app.stringIDToTypeID("lineWidth"), app.charIDToTypeID('#Pxl'), 1);
    desc14.putUnitDouble(app.stringIDToTypeID("miterLimit"), app.charIDToTypeID('#Pxl'), 4);
    desc14.putDouble(app.stringIDToTypeID("lineDashoffset"), 0);
    desc11.putObject(app.stringIDToTypeID("baseParentStyle"), app.charIDToTypeID('TxtS'), desc14);
    desc10.putObject(app.charIDToTypeID('TxtS'), app.charIDToTypeID('TxtS'), desc11);
    list2.putObject(app.charIDToTypeID('Txtt'), desc10);
    desc2.putList(app.charIDToTypeID('Txtt'), list2);
    var list3 = new ActionList();
    var desc17 = new ActionDescriptor();
    desc17.putInteger(app.charIDToTypeID('From'), 0);
    desc17.putInteger(app.charIDToTypeID('T   '), 18);
    var desc18 = new ActionDescriptor();
    desc18.putBoolean(app.stringIDToTypeID("styleSheetHasParent"), true);
    desc18.putEnumerated(app.charIDToTypeID('Algn'), app.charIDToTypeID('Alg '), app.charIDToTypeID('Left'));
    desc18.putUnitDouble(app.stringIDToTypeID("firstLineIndent"), app.charIDToTypeID('#Pxl'), 0);
    desc18.putUnitDouble(app.stringIDToTypeID("startIndent"), app.charIDToTypeID('#Pxl'), 0);
    desc18.putUnitDouble(app.stringIDToTypeID("endIndent"), app.charIDToTypeID('#Pxl'), 0);
    desc18.putUnitDouble(app.stringIDToTypeID("spaceBefore"), app.charIDToTypeID('#Pxl'), 0);
    desc18.putUnitDouble(app.stringIDToTypeID("spaceAfter"), app.charIDToTypeID('#Pxl'), 0);
    desc18.putDouble(app.stringIDToTypeID("autoLeadingPercentage"), 1.20000004768372);
    desc18.putEnumerated(app.stringIDToTypeID("leadingType"), app.stringIDToTypeID("leadingType"), app.stringIDToTypeID("leadingBelow"));
    desc18.putEnumerated(app.stringIDToTypeID("directionType"), app.stringIDToTypeID("directionType"), app.stringIDToTypeID("dirLeftToRight"));
    desc18.putEnumerated(app.stringIDToTypeID("kashidaWidthType"), app.stringIDToTypeID("kashidaWidthType"), app.stringIDToTypeID("kashidaWidthMedium"));
    desc18.putBoolean(app.stringIDToTypeID("hyphenate"), false);
    desc18.putDouble(app.stringIDToTypeID("justificationWordMinimum"), 0.80000001192093);
    desc18.putDouble(app.stringIDToTypeID("justificationWordDesired"), 1);
    desc18.putDouble(app.stringIDToTypeID("justificationWordMaximum"), 1.33000004291534);
    desc18.putDouble(app.stringIDToTypeID("justificationLetterMinimum"), 0);
    desc18.putDouble(app.stringIDToTypeID("justificationLetterDesired"), 0);
    desc18.putDouble(app.stringIDToTypeID("justificationLetterMaximum"), 0);
    desc18.putDouble(app.stringIDToTypeID("justificationGlyphMinimum"), 1);
    desc18.putDouble(app.stringIDToTypeID("justificationGlyphDesired"), 1);
    desc18.putDouble(app.stringIDToTypeID("justificationGlyphMaximum"), 1);
    desc18.putBoolean(app.stringIDToTypeID("hangingRoman"), false);
    desc18.putEnumerated(app.stringIDToTypeID("burasagari"), app.stringIDToTypeID("burasagari"), app.stringIDToTypeID("burasagariStandard"));
    desc18.putEnumerated(app.stringIDToTypeID("preferredKinsokuOrder"), app.stringIDToTypeID("preferredKinsokuOrder"), app.stringIDToTypeID("pushIn"));
    desc18.putBoolean(app.stringIDToTypeID("textEveryLineComposer"), false);
    desc18.putEnumerated(app.stringIDToTypeID("textComposerEngine"), app.stringIDToTypeID("textComposerEngine"), app.stringIDToTypeID("textLatinCJKComposer"));
    desc17.putObject(app.stringIDToTypeID("paragraphStyle"), app.stringIDToTypeID("paragraphStyle"), desc18);
    list3.putObject(app.stringIDToTypeID("paragraphStyleRange"), desc17);
    desc2.putList(app.stringIDToTypeID("paragraphStyleRange"), list3);
    var list4 = new ActionList();
    desc2.putList(app.stringIDToTypeID("kerningRange"), list4);
    desc1.putObject(app.charIDToTypeID('Usng'), app.charIDToTypeID('TxLr'), desc2);
    executeAction(app.charIDToTypeID('Mk  '), desc1, dialogMode);
//end text1

    var text1Layer = docRef.activeLayer; 

//text2
var desc1 = new ActionDescriptor();
    var ref1 = new ActionReference();
    ref1.putClass(app.charIDToTypeID('TxLr'));
    desc1.putReference(app.charIDToTypeID('null'), ref1);
    var desc2 = new ActionDescriptor();
    desc2.putString(app.charIDToTypeID('Txt '), "S");
    var desc3 = new ActionDescriptor();
    desc3.putEnumerated(app.stringIDToTypeID("warpStyle"), app.stringIDToTypeID("warpStyle"), app.stringIDToTypeID("warpNone"));
    desc3.putDouble(app.stringIDToTypeID("warpValue"), 0);
    desc3.putDouble(app.stringIDToTypeID("warpPerspective"), 0);
    desc3.putDouble(app.stringIDToTypeID("warpPerspectiveOther"), 0);
    desc3.putEnumerated(app.stringIDToTypeID("warpRotate"), app.charIDToTypeID('Ornt'), app.charIDToTypeID('Hrzn'));
    desc2.putObject(app.charIDToTypeID('warp'), app.charIDToTypeID('warp'), desc3);
    var desc4 = new ActionDescriptor();
    desc4.putUnitDouble(app.charIDToTypeID('Hrzn'), app.charIDToTypeID('#Prc'), 10.6403013182674);
    desc4.putUnitDouble(app.charIDToTypeID('Vrtc'), app.charIDToTypeID('#Prc'), 18.271954674221);
    desc2.putObject(app.charIDToTypeID('TxtC'), app.charIDToTypeID('Pnt '), desc4);
    desc2.putEnumerated(app.stringIDToTypeID("textGridding"), app.stringIDToTypeID("textGridding"), app.charIDToTypeID('None'));
    desc2.putEnumerated(app.charIDToTypeID('Ornt'), app.charIDToTypeID('Ornt'), app.charIDToTypeID('Hrzn'));
    desc2.putEnumerated(app.charIDToTypeID('AntA'), app.charIDToTypeID('Annt'), app.charIDToTypeID('AnSm'));
    var desc5 = new ActionDescriptor();
    desc5.putUnitDouble(app.charIDToTypeID('Left'), app.charIDToTypeID('#Pxl'), 0);
    desc5.putUnitDouble(app.charIDToTypeID('Top '), app.charIDToTypeID('#Pxl'), -27.8835296630859);
    desc5.putUnitDouble(app.charIDToTypeID('Rght'), app.charIDToTypeID('#Pxl'), 1266.36840820312);
    desc5.putUnitDouble(app.charIDToTypeID('Btom'), app.charIDToTypeID('#Pxl'), 946.666625976562);
    desc2.putObject(app.stringIDToTypeID("bounds"), app.stringIDToTypeID("bounds"), desc5);
    var desc6 = new ActionDescriptor();
    desc6.putUnitDouble(app.charIDToTypeID('Left'), app.charIDToTypeID('#Pxl'), 10.609375);
    desc6.putUnitDouble(app.charIDToTypeID('Top '), app.charIDToTypeID('#Pxl'), 16.9499664306641);
    desc6.putUnitDouble(app.charIDToTypeID('Rght'), app.charIDToTypeID('#Pxl'), 197.125);
    desc6.putUnitDouble(app.charIDToTypeID('Btom'), app.charIDToTypeID('#Pxl'), 221.949966430664);
    desc2.putObject(app.stringIDToTypeID("boundingBox"), app.stringIDToTypeID("boundingBox"), desc6);
    var list1 = new ActionList();
    var desc7 = new ActionDescriptor();
    desc7.putEnumerated(app.stringIDToTypeID("textType"), app.stringIDToTypeID("textType"), app.stringIDToTypeID("box"));
    desc7.putEnumerated(app.charIDToTypeID('Ornt'), app.charIDToTypeID('Ornt'), app.charIDToTypeID('Hrzn'));
    var desc8 = new ActionDescriptor();
    desc8.putDouble(app.stringIDToTypeID("xx"), 1);
    desc8.putDouble(app.stringIDToTypeID("xy"), 0);
    desc8.putDouble(app.stringIDToTypeID("yx"), 0);
    desc8.putDouble(app.stringIDToTypeID("yy"), 1);
    desc8.putDouble(app.stringIDToTypeID("tx"), 0);
    desc8.putDouble(app.stringIDToTypeID("ty"), 0);
    desc7.putObject(app.charIDToTypeID('Trnf'), app.charIDToTypeID('Trnf'), desc8);
    desc7.putInteger(app.stringIDToTypeID("rowCount"), 1);
    desc7.putInteger(app.stringIDToTypeID("columnCount"), 1);
    desc7.putBoolean(app.stringIDToTypeID("rowMajorOrder"), true);
    desc7.putUnitDouble(app.stringIDToTypeID("rowGutter"), app.charIDToTypeID('#Pxl'), 0);
    desc7.putUnitDouble(app.stringIDToTypeID("columnGutter"), app.charIDToTypeID('#Pxl'), 0);
    desc7.putUnitDouble(app.charIDToTypeID('Spcn'), app.charIDToTypeID('#Pxl'), 0);
    desc7.putEnumerated(app.stringIDToTypeID("frameBaselineAlignment"), app.stringIDToTypeID("frameBaselineAlignment"), app.stringIDToTypeID("alignByAscent"));
    desc7.putUnitDouble(app.stringIDToTypeID("firstBaselineMinimum"), app.charIDToTypeID('#Pxl'), 0);
    var desc9 = new ActionDescriptor();
    desc9.putDouble(app.charIDToTypeID('Top '), 0);
    desc9.putDouble(app.charIDToTypeID('Left'), 0);
    desc9.putDouble(app.charIDToTypeID('Btom'), 284);
    desc9.putDouble(app.charIDToTypeID('Rght'), 379.910522460938);
    desc7.putObject(app.stringIDToTypeID("bounds"), app.charIDToTypeID('Rctn'), desc9);
    list1.putObject(app.stringIDToTypeID("textShape"), desc7);
    desc2.putList(app.stringIDToTypeID("textShape"), list1);
    var list2 = new ActionList();
    var desc10 = new ActionDescriptor();
    desc10.putInteger(app.charIDToTypeID('From'), 0);
    desc10.putInteger(app.charIDToTypeID('T   '), 2);
    var desc11 = new ActionDescriptor();
    desc11.putBoolean(app.stringIDToTypeID("styleSheetHasParent"), true);
    desc11.putString(app.stringIDToTypeID("fontPostScriptName"), "ComicSansMS");
    desc11.putString(app.charIDToTypeID('FntN'), "Comic Sans MS");
    desc11.putString(app.charIDToTypeID('FntS'), "Bold Italic");
    desc11.putInteger(app.charIDToTypeID('Scrp'), 0);
    desc11.putInteger(app.charIDToTypeID('FntT'), 1);
    desc11.putUnitDouble(app.charIDToTypeID('Sz  '), app.charIDToTypeID('#Pxl'), 275);
    desc11.putDouble(app.charIDToTypeID('HrzS'), 100);
    desc11.putDouble(app.charIDToTypeID('VrtS'), 100);
    desc11.putBoolean(app.stringIDToTypeID("syntheticBold"), false);
    desc11.putBoolean(app.stringIDToTypeID("syntheticItalic"), false);
    desc11.putBoolean(app.stringIDToTypeID("autoLeading"), true);
    desc11.putInteger(app.charIDToTypeID('Trck'), 0);
    desc11.putUnitDouble(app.charIDToTypeID('Bsln'), app.charIDToTypeID('#Pxl'), 0);
    desc11.putEnumerated(app.charIDToTypeID('AtKr'), app.charIDToTypeID('AtKr'), app.stringIDToTypeID("metricsKern"));
    desc11.putEnumerated(app.stringIDToTypeID("fontCaps"), app.stringIDToTypeID("fontCaps"), app.charIDToTypeID('Nrml'));
    desc11.putEnumerated(app.stringIDToTypeID("digitSet"), app.stringIDToTypeID("digitSet"), app.stringIDToTypeID("defaultDigits"));
    desc11.putEnumerated(app.stringIDToTypeID("kashidas"), app.stringIDToTypeID("kashidas"), app.stringIDToTypeID("kashidaDefault"));
    desc11.putUnitDouble(app.stringIDToTypeID("diacXOffset"), app.charIDToTypeID('#Pxl'), 0);
    desc11.putUnitDouble(app.stringIDToTypeID("diacYOffset"), app.charIDToTypeID('#Pxl'), 0);
    desc11.putUnitDouble(app.stringIDToTypeID("markYDistFromBaseline"), app.charIDToTypeID('#Pxl'), 1.38240003585815);
    desc11.putEnumerated(app.stringIDToTypeID("baseline"), app.stringIDToTypeID("baseline"), app.charIDToTypeID('Nrml'));
    desc11.putEnumerated(app.stringIDToTypeID("strikethrough"), app.stringIDToTypeID("strikethrough"), app.stringIDToTypeID("strikethroughOff"));
    desc11.putEnumerated(app.charIDToTypeID('Undl'), app.charIDToTypeID('Undl'), app.stringIDToTypeID("underlineOff"));
    desc11.putBoolean(app.stringIDToTypeID("ligature"), true);
    desc11.putBoolean(app.stringIDToTypeID("altligature"), false);
    desc11.putBoolean(app.stringIDToTypeID("contextualLigatures"), false);
    desc11.putBoolean(app.stringIDToTypeID("fractions"), false);
    desc11.putBoolean(app.stringIDToTypeID("ordinals"), false);
    desc11.putBoolean(app.stringIDToTypeID("swash"), false);
    desc11.putBoolean(app.stringIDToTypeID("titling"), false);
    desc11.putBoolean(app.stringIDToTypeID("connectionForms"), false);
    desc11.putBoolean(app.stringIDToTypeID("stylisticAlternates"), false);
    desc11.putBoolean(app.stringIDToTypeID("ornaments"), false);
    desc11.putBoolean(app.stringIDToTypeID("justificationAlternates"), false);
    desc11.putEnumerated(app.stringIDToTypeID("figureStyle"), app.stringIDToTypeID("figureStyle"), app.charIDToTypeID('Nrml'));
    desc11.putBoolean(app.stringIDToTypeID("proportionalMetrics"), false);
    desc11.putBoolean(app.charIDToTypeID('kana'), false);
    desc11.putBoolean(app.stringIDToTypeID("italics"), false);
    desc11.putEnumerated(app.stringIDToTypeID("baselineDirection"), app.stringIDToTypeID("baselineDirection"), app.stringIDToTypeID("withStream"));
    desc11.putEnumerated(app.stringIDToTypeID("textLanguage"), app.stringIDToTypeID("textLanguage"), app.stringIDToTypeID("englishLanguage"));
    desc11.putEnumerated(app.stringIDToTypeID("japaneseAlternate"), app.stringIDToTypeID("japaneseAlternate"), app.stringIDToTypeID("defaultForm"));
    desc11.putDouble(app.stringIDToTypeID("mojiZume"), 0);
    desc11.putEnumerated(app.stringIDToTypeID("gridAlignment"), app.stringIDToTypeID("gridAlignment"), app.stringIDToTypeID("roman"));
    desc11.putBoolean(app.stringIDToTypeID("noBreak"), false);
    var desc12 = new ActionDescriptor();
    desc12.putDouble(app.charIDToTypeID('Rd  '), 255);
    desc12.putDouble(app.charIDToTypeID('Grn '), 0);
    desc12.putDouble(app.charIDToTypeID('Bl  '), 0);
    desc11.putObject(app.charIDToTypeID('Clr '), app.stringIDToTypeID("RGBColor"), desc12);
    var desc13 = new ActionDescriptor();
    desc13.putDouble(app.charIDToTypeID('Rd  '), 0);
    desc13.putDouble(app.charIDToTypeID('Grn '), 0);
    desc13.putDouble(app.charIDToTypeID('Bl  '), 0);
    desc11.putObject(app.stringIDToTypeID("strokeColor"), app.stringIDToTypeID("RGBColor"), desc13);
    var desc14 = new ActionDescriptor();
    desc14.putString(app.stringIDToTypeID("fontPostScriptName"), "MyriadPro-Regular");
    desc14.putString(app.charIDToTypeID('FntN'), "Myriad Pro");
    desc14.putString(app.charIDToTypeID('FntS'), "Regular");
    desc14.putInteger(app.charIDToTypeID('Scrp'), 0);
    desc14.putInteger(app.charIDToTypeID('FntT'), 0);
    desc14.putUnitDouble(app.charIDToTypeID('Sz  '), app.charIDToTypeID('#Pxl'), 12);
    desc14.putDouble(app.charIDToTypeID('HrzS'), 100);
    desc14.putDouble(app.charIDToTypeID('VrtS'), 100);
    desc14.putBoolean(app.stringIDToTypeID("syntheticBold"), false);
    desc14.putBoolean(app.stringIDToTypeID("syntheticItalic"), false);
    desc14.putBoolean(app.stringIDToTypeID("autoLeading"), true);
    desc14.putInteger(app.charIDToTypeID('Trck'), 0);
    desc14.putUnitDouble(app.charIDToTypeID('Bsln'), app.charIDToTypeID('#Pxl'), 0);
    desc14.putDouble(app.stringIDToTypeID("characterRotation"), 0);
    desc14.putEnumerated(app.charIDToTypeID('AtKr'), app.charIDToTypeID('AtKr'), app.stringIDToTypeID("metricsKern"));
    desc14.putEnumerated(app.stringIDToTypeID("fontCaps"), app.stringIDToTypeID("fontCaps"), app.charIDToTypeID('Nrml'));
    desc14.putEnumerated(app.stringIDToTypeID("digitSet"), app.stringIDToTypeID("digitSet"), app.stringIDToTypeID("defaultDigits"));
    desc14.putEnumerated(app.stringIDToTypeID("dirOverride"), app.stringIDToTypeID("dirOverride"), app.stringIDToTypeID("dirOverrideDefault"));
    desc14.putEnumerated(app.stringIDToTypeID("kashidas"), app.stringIDToTypeID("kashidas"), app.stringIDToTypeID("kashidaDefault"));
    desc14.putEnumerated(app.stringIDToTypeID("diacVPos"), app.stringIDToTypeID("diacVPos"), app.stringIDToTypeID("diacVPosOpenType"));
    desc14.putUnitDouble(app.stringIDToTypeID("diacXOffset"), app.charIDToTypeID('#Pxl'), 0);
    desc14.putUnitDouble(app.stringIDToTypeID("diacYOffset"), app.charIDToTypeID('#Pxl'), 0);
    desc14.putUnitDouble(app.stringIDToTypeID("markYDistFromBaseline"), app.charIDToTypeID('#Pxl'), 100);
    desc14.putEnumerated(app.stringIDToTypeID("baseline"), app.stringIDToTypeID("baseline"), app.charIDToTypeID('Nrml'));
    desc14.putEnumerated(app.stringIDToTypeID("otbaseline"), app.stringIDToTypeID("otbaseline"), app.charIDToTypeID('Nrml'));
    desc14.putEnumerated(app.stringIDToTypeID("strikethrough"), app.stringIDToTypeID("strikethrough"), app.stringIDToTypeID("strikethroughOff"));
    desc14.putEnumerated(app.charIDToTypeID('Undl'), app.charIDToTypeID('Undl'), app.stringIDToTypeID("underlineOff"));
    desc14.putUnitDouble(app.stringIDToTypeID("underlineOffset"), app.charIDToTypeID('#Pxl'), 0);
    desc14.putBoolean(app.stringIDToTypeID("ligature"), true);
    desc14.putBoolean(app.stringIDToTypeID("altligature"), false);
    desc14.putBoolean(app.stringIDToTypeID("contextualLigatures"), false);
    desc14.putBoolean(app.stringIDToTypeID("alternateLigatures"), false);
    desc14.putBoolean(app.stringIDToTypeID("oldStyle"), false);
    desc14.putBoolean(app.stringIDToTypeID("fractions"), false);
    desc14.putBoolean(app.stringIDToTypeID("ordinals"), false);
    desc14.putBoolean(app.stringIDToTypeID("swash"), false);
    desc14.putBoolean(app.stringIDToTypeID("titling"), false);
    desc14.putBoolean(app.stringIDToTypeID("connectionForms"), false);
    desc14.putBoolean(app.stringIDToTypeID("stylisticAlternates"), false);
    desc14.putBoolean(app.stringIDToTypeID("ornaments"), false);
    desc14.putBoolean(app.stringIDToTypeID("justificationAlternates"), false);
    desc14.putEnumerated(app.stringIDToTypeID("figureStyle"), app.stringIDToTypeID("figureStyle"), app.charIDToTypeID('Nrml'));
    desc14.putBoolean(app.stringIDToTypeID("proportionalMetrics"), false);
    desc14.putBoolean(app.charIDToTypeID('kana'), false);
    desc14.putBoolean(app.stringIDToTypeID("italics"), false);
    desc14.putBoolean(app.charIDToTypeID('ruby'), false);
    desc14.putEnumerated(app.stringIDToTypeID("baselineDirection"), app.stringIDToTypeID("baselineDirection"), app.stringIDToTypeID("rotated"));
    desc14.putEnumerated(app.stringIDToTypeID("textLanguage"), app.stringIDToTypeID("textLanguage"), app.stringIDToTypeID("englishLanguage"));
    desc14.putEnumerated(app.stringIDToTypeID("japaneseAlternate"), app.stringIDToTypeID("japaneseAlternate"), app.stringIDToTypeID("defaultForm"));
    desc14.putDouble(app.stringIDToTypeID("mojiZume"), 0);
    desc14.putEnumerated(app.stringIDToTypeID("gridAlignment"), app.stringIDToTypeID("gridAlignment"), app.stringIDToTypeID("roman"));
    desc14.putBoolean(app.stringIDToTypeID("enableWariChu"), false);
    desc14.putInteger(app.stringIDToTypeID("wariChuCount"), 2);
    desc14.putInteger(app.stringIDToTypeID("wariChuLineGap"), 0);
    desc14.putDouble(app.stringIDToTypeID("wariChuScale"), 0.5);
    desc14.putInteger(app.stringIDToTypeID("wariChuWidow"), 2);
    desc14.putInteger(app.stringIDToTypeID("wariChuOrphan"), 2);
    desc14.putEnumerated(app.stringIDToTypeID("wariChuJustification"), app.stringIDToTypeID("wariChuJustification"), app.stringIDToTypeID("wariChuAutoJustify"));
    desc14.putInteger(app.stringIDToTypeID("tcyUpDown"), 0);
    desc14.putInteger(app.stringIDToTypeID("tcyLeftRight"), 0);
    desc14.putDouble(app.stringIDToTypeID("leftAki"), -1);
    desc14.putDouble(app.stringIDToTypeID("rightAki"), -1);
    desc14.putInteger(app.stringIDToTypeID("jiDori"), 0);
    desc14.putBoolean(app.stringIDToTypeID("noBreak"), false);
    var desc15 = new ActionDescriptor();
    desc15.putDouble(app.charIDToTypeID('Rd  '), 0);
    desc15.putDouble(app.charIDToTypeID('Grn '), 0);
    desc15.putDouble(app.charIDToTypeID('Bl  '), 0);
    desc14.putObject(app.charIDToTypeID('Clr '), app.stringIDToTypeID("RGBColor"), desc15);
    var desc16 = new ActionDescriptor();
    desc16.putDouble(app.charIDToTypeID('Rd  '), 0);
    desc16.putDouble(app.charIDToTypeID('Grn '), 0);
    desc16.putDouble(app.charIDToTypeID('Bl  '), 0);
    desc14.putObject(app.stringIDToTypeID("strokeColor"), app.stringIDToTypeID("RGBColor"), desc16);
    desc14.putBoolean(app.charIDToTypeID('Fl  '), true);
    desc14.putBoolean(app.charIDToTypeID('Strk'), false);
    desc14.putBoolean(app.stringIDToTypeID("fillFirst"), true);
    desc14.putBoolean(app.stringIDToTypeID("fillOverPrint"), false);
    desc14.putBoolean(app.stringIDToTypeID("strokeOverPrint"), false);
    desc14.putEnumerated(app.stringIDToTypeID("lineCap"), app.stringIDToTypeID("lineCap"), app.stringIDToTypeID("buttCap"));
    desc14.putEnumerated(app.stringIDToTypeID("lineJoin"), app.stringIDToTypeID("lineJoin"), app.stringIDToTypeID("miterJoin"));
    desc14.putUnitDouble(app.stringIDToTypeID("lineWidth"), app.charIDToTypeID('#Pxl'), 1);
    desc14.putUnitDouble(app.stringIDToTypeID("miterLimit"), app.charIDToTypeID('#Pxl'), 4);
    desc14.putDouble(app.stringIDToTypeID("lineDashoffset"), 0);
    desc11.putObject(app.stringIDToTypeID("baseParentStyle"), app.charIDToTypeID('TxtS'), desc14);
    desc10.putObject(app.charIDToTypeID('TxtS'), app.charIDToTypeID('TxtS'), desc11);
    list2.putObject(app.charIDToTypeID('Txtt'), desc10);
    desc2.putList(app.charIDToTypeID('Txtt'), list2);
    var list3 = new ActionList();
    var desc17 = new ActionDescriptor();
    desc17.putInteger(app.charIDToTypeID('From'), 0);
    desc17.putInteger(app.charIDToTypeID('T   '), 2);
    var desc18 = new ActionDescriptor();
    desc18.putBoolean(app.stringIDToTypeID("styleSheetHasParent"), true);
    desc18.putEnumerated(app.charIDToTypeID('Algn'), app.charIDToTypeID('Alg '), app.charIDToTypeID('Left'));
    desc18.putUnitDouble(app.stringIDToTypeID("firstLineIndent"), app.charIDToTypeID('#Pxl'), 0);
    desc18.putUnitDouble(app.stringIDToTypeID("startIndent"), app.charIDToTypeID('#Pxl'), 0);
    desc18.putUnitDouble(app.stringIDToTypeID("endIndent"), app.charIDToTypeID('#Pxl'), 0);
    desc18.putUnitDouble(app.stringIDToTypeID("spaceBefore"), app.charIDToTypeID('#Pxl'), 0);
    desc18.putUnitDouble(app.stringIDToTypeID("spaceAfter"), app.charIDToTypeID('#Pxl'), 0);
    desc18.putDouble(app.stringIDToTypeID("autoLeadingPercentage"), 1.20000004768372);
    desc18.putEnumerated(app.stringIDToTypeID("leadingType"), app.stringIDToTypeID("leadingType"), app.stringIDToTypeID("leadingBelow"));
    desc18.putEnumerated(app.stringIDToTypeID("directionType"), app.stringIDToTypeID("directionType"), app.stringIDToTypeID("dirLeftToRight"));
    desc18.putEnumerated(app.stringIDToTypeID("kashidaWidthType"), app.stringIDToTypeID("kashidaWidthType"), app.stringIDToTypeID("kashidaWidthMedium"));
    desc18.putBoolean(app.stringIDToTypeID("hyphenate"), false);
    desc18.putDouble(app.stringIDToTypeID("justificationWordMinimum"), 0.80000001192093);
    desc18.putDouble(app.stringIDToTypeID("justificationWordDesired"), 1);
    desc18.putDouble(app.stringIDToTypeID("justificationWordMaximum"), 1.33000004291534);
    desc18.putDouble(app.stringIDToTypeID("justificationLetterMinimum"), 0);
    desc18.putDouble(app.stringIDToTypeID("justificationLetterDesired"), 0);
    desc18.putDouble(app.stringIDToTypeID("justificationLetterMaximum"), 0);
    desc18.putDouble(app.stringIDToTypeID("justificationGlyphMinimum"), 1);
    desc18.putDouble(app.stringIDToTypeID("justificationGlyphDesired"), 1);
    desc18.putDouble(app.stringIDToTypeID("justificationGlyphMaximum"), 1);
    desc18.putBoolean(app.stringIDToTypeID("hangingRoman"), false);
    desc18.putEnumerated(app.stringIDToTypeID("burasagari"), app.stringIDToTypeID("burasagari"), app.stringIDToTypeID("burasagariStandard"));
    desc18.putEnumerated(app.stringIDToTypeID("preferredKinsokuOrder"), app.stringIDToTypeID("preferredKinsokuOrder"), app.stringIDToTypeID("pushIn"));
    desc18.putBoolean(app.stringIDToTypeID("textEveryLineComposer"), true);
    desc18.putEnumerated(app.stringIDToTypeID("textComposerEngine"), app.stringIDToTypeID("textComposerEngine"), app.stringIDToTypeID("textLatinCJKComposer"));
    desc17.putObject(app.stringIDToTypeID("paragraphStyle"), app.stringIDToTypeID("paragraphStyle"), desc18);
    list3.putObject(app.stringIDToTypeID("paragraphStyleRange"), desc17);
    desc2.putList(app.stringIDToTypeID("paragraphStyleRange"), list3);
    var list4 = new ActionList();
    desc2.putList(app.stringIDToTypeID("kerningRange"), list4);
    desc1.putObject(app.charIDToTypeID('Usng'), app.charIDToTypeID('TxLr'), desc2);
    executeAction(app.charIDToTypeID('Mk  '), desc1, dialogMode);
    
    //style
      var desc1 = new ActionDescriptor();
    var ref1 = new ActionReference();
    ref1.putProperty(app.charIDToTypeID('Prpr'), app.charIDToTypeID('Lefx'));
    ref1.putEnumerated(app.charIDToTypeID('Lyr '), app.charIDToTypeID('Ordn'), app.charIDToTypeID('Trgt'));
    desc1.putReference(app.charIDToTypeID('null'), ref1);
    var desc2 = new ActionDescriptor();
    desc2.putUnitDouble(app.charIDToTypeID('Scl '), app.charIDToTypeID('#Prc'), docRef.resolution/72);
    var desc3 = new ActionDescriptor();
    desc3.putBoolean(app.charIDToTypeID('enab'), true);
    desc3.putEnumerated(app.charIDToTypeID('Md  '), app.charIDToTypeID('BlnM'), app.charIDToTypeID('Mltp'));
    var desc4 = new ActionDescriptor();
    desc4.putDouble(app.charIDToTypeID('Rd  '), 0.25491042004433);
    desc4.putDouble(app.charIDToTypeID('Grn '), 0.49151558952872);
    desc4.putDouble(app.charIDToTypeID('Bl  '), 0.50261559546925);
    desc3.putObject(app.charIDToTypeID('Clr '), app.stringIDToTypeID("RGBColor"), desc4);
    desc3.putUnitDouble(app.charIDToTypeID('Opct'), app.charIDToTypeID('#Prc'), 100);
    desc3.putBoolean(app.charIDToTypeID('uglg'), false);
    desc3.putUnitDouble(app.charIDToTypeID('lagl'), app.charIDToTypeID('#Ang'), 45);
    desc3.putUnitDouble(app.charIDToTypeID('Dstn'), app.charIDToTypeID('#Pxl'), 18);
    desc3.putUnitDouble(app.charIDToTypeID('Ckmt'), app.charIDToTypeID('#Pxl'), 100);
    desc3.putUnitDouble(app.charIDToTypeID('blur'), app.charIDToTypeID('#Pxl'), 7);
    desc3.putUnitDouble(app.charIDToTypeID('Nose'), app.charIDToTypeID('#Prc'), 0);
    desc3.putBoolean(app.charIDToTypeID('AntA'), false);
    var desc5 = new ActionDescriptor();
    desc5.putString(app.charIDToTypeID('Nm  '), "$$$/Contours/Defaults/Linear=Linear");
    desc3.putObject(app.charIDToTypeID('TrnS'), app.charIDToTypeID('ShpC'), desc5);
    desc3.putBoolean(app.stringIDToTypeID("layerConceals"), true);
    desc2.putObject(app.charIDToTypeID('DrSh'), app.charIDToTypeID('DrSh'), desc3);
    var desc6 = new ActionDescriptor();
    desc6.putBoolean(app.charIDToTypeID('enab'), true);
    desc6.putEnumerated(app.charIDToTypeID('Styl'), app.charIDToTypeID('FStl'), app.charIDToTypeID('OutF'));
    desc6.putEnumerated(app.charIDToTypeID('PntT'), app.charIDToTypeID('FrFl'), app.charIDToTypeID('SClr'));
    desc6.putEnumerated(app.charIDToTypeID('Md  '), app.charIDToTypeID('BlnM'), app.charIDToTypeID('Nrml'));
    desc6.putUnitDouble(app.charIDToTypeID('Opct'), app.charIDToTypeID('#Prc'), 100);
    desc6.putUnitDouble(app.charIDToTypeID('Sz  '), app.charIDToTypeID('#Pxl'), 7);
    var desc7 = new ActionDescriptor();
    desc7.putDouble(app.charIDToTypeID('Rd  '), 0.25491042004433);
    desc7.putDouble(app.charIDToTypeID('Grn '), 0.49151558952872);
    desc7.putDouble(app.charIDToTypeID('Bl  '), 0.50261559546925);
    desc6.putObject(app.charIDToTypeID('Clr '), app.stringIDToTypeID("RGBColor"), desc7);
    desc2.putObject(app.charIDToTypeID('FrFX'), app.charIDToTypeID('FrFX'), desc6);
    desc1.putObject(app.charIDToTypeID('T   '), app.charIDToTypeID('Lefx'), desc2);
    executeAction(app.charIDToTypeID('setd'), desc1, dialogMode);
    
//end text2
 var text2Layer = docRef.activeLayer; 


   var newSet = text1Layer.parent.layerSets.add();
   newSet.name = "Header Box";
   this.setLayerYellow();
        
         shapeLayer.move(newSet,ElementPlacement.INSIDE);
         text1Layer.move(newSet,ElementPlacement.INSIDE);
         text2Layer.move(newSet,ElementPlacement.INSIDE);
         
       this.centerLayerToDoc(text1Layer,docRef);
       this.centerLayerToDoc(text2Layer,docRef);
       
       text2Layer.translate(shapeLayer.bounds[0]-text2Layer.bounds[0]+30,0);
        text1Layer.translate(text2Layer.bounds[2]-text1Layer.bounds[0]+10,0);
         
     docRef.activeLayer = newSet;
     
    break;
    
    case "caption":
    if(!app.documents.length) return;
         var docRef = app.activeDocument;
         
          var desc1 = new ActionDescriptor();
    var ref1 = new ActionReference();
    ref1.putClass(app.stringIDToTypeID("contentLayer"));
    desc1.putReference(app.charIDToTypeID('null'), ref1);
    var desc2 = new ActionDescriptor();
    var desc3 = new ActionDescriptor();
    var desc4 = new ActionDescriptor();
    desc4.putDouble(app.charIDToTypeID('Rd  '), 255);
    desc4.putDouble(app.charIDToTypeID('Grn '), 255);
    desc4.putDouble(app.charIDToTypeID('Bl  '), 255);
    desc3.putObject(app.charIDToTypeID('Clr '), app.stringIDToTypeID("RGBColor"), desc4);
    desc2.putObject(app.charIDToTypeID('Type'), app.stringIDToTypeID("solidColorLayer"), desc3);
    var desc5 = new ActionDescriptor();
    desc5.putInteger(app.stringIDToTypeID("unitValueQuadVersion"), 1);
    desc5.putUnitDouble(app.charIDToTypeID('Top '), app.charIDToTypeID('#Pxl'), 336);
    desc5.putUnitDouble(app.charIDToTypeID('Left'), app.charIDToTypeID('#Pxl'), 263);
    desc5.putUnitDouble(app.charIDToTypeID('Btom'), app.charIDToTypeID('#Pxl'), 534);
    desc5.putUnitDouble(app.charIDToTypeID('Rght'), app.charIDToTypeID('#Pxl'), 1166);
    desc5.putUnitDouble(app.stringIDToTypeID("topRight"), app.charIDToTypeID('#Pxl'), -1);
    desc5.putUnitDouble(app.stringIDToTypeID("topLeft"), app.charIDToTypeID('#Pxl'), -1);
    desc5.putUnitDouble(app.stringIDToTypeID("bottomLeft"), app.charIDToTypeID('#Pxl'), -1);
    desc5.putUnitDouble(app.stringIDToTypeID("bottomRight"), app.charIDToTypeID('#Pxl'), -1);
    desc2.putObject(app.charIDToTypeID('Shp '), app.charIDToTypeID('Rctn'), desc5);
    desc1.putObject(app.charIDToTypeID('Usng'), app.stringIDToTypeID("contentLayer"), desc2);
    executeAction(app.charIDToTypeID('Mk  '), desc1, dialogMode);
    
    
    //set style
    //set style
    var idsetd = charIDToTypeID( "setd" );
    var desc20 = new ActionDescriptor();
    var idnull = charIDToTypeID( "null" );
        var ref15 = new ActionReference();
        var idPrpr = charIDToTypeID( "Prpr" );
        var idLefx = charIDToTypeID( "Lefx" );
        ref15.putProperty( idPrpr, idLefx );
        var idLyr = charIDToTypeID( "Lyr " );
        var idOrdn = charIDToTypeID( "Ordn" );
        var idTrgt = charIDToTypeID( "Trgt" );
        ref15.putEnumerated( idLyr, idOrdn, idTrgt );
    desc20.putReference( idnull, ref15 );
    var idT = charIDToTypeID( "T   " );
        var desc21 = new ActionDescriptor();
        var idScl = charIDToTypeID( "Scl " );
        var idPrc = charIDToTypeID( "#Prc" );
        desc21.putUnitDouble( idScl, idPrc, docRef.resolution/72 );
     
        var idFrFX = charIDToTypeID( "FrFX" );
            var desc29 = new ActionDescriptor();
            var idenab = charIDToTypeID( "enab" );
            desc29.putBoolean( idenab, true );
            var idStyl = charIDToTypeID( "Styl" );
            var idFStl = charIDToTypeID( "FStl" );
            var idOutF = charIDToTypeID( "InsF" );
            desc29.putEnumerated( idStyl, idFStl, idOutF );
            var idPntT = charIDToTypeID( "PntT" );
            var idFrFl = charIDToTypeID( "FrFl" );
            var idSClr = charIDToTypeID( "SClr" );
            desc29.putEnumerated( idPntT, idFrFl, idSClr );
            var idMd = charIDToTypeID( "Md  " );
            var idBlnM = charIDToTypeID( "BlnM" );
            var idNrml = charIDToTypeID( "Nrml" );
            desc29.putEnumerated( idMd, idBlnM, idNrml );
            var idOpct = charIDToTypeID( "Opct" );
            var idPrc = charIDToTypeID( "#Prc" );
            desc29.putUnitDouble( idOpct, idPrc, 100.000000 );
            var idSz = charIDToTypeID( "Sz  " );
            var idPxl = charIDToTypeID( "#Pxl" );
            desc29.putUnitDouble( idSz, idPxl, 6.000000 );
            var idClr = charIDToTypeID( "Clr " );
                var desc30 = new ActionDescriptor();
                var idRd = charIDToTypeID( "Rd  " );
                desc30.putDouble( idRd, 0.254910 );
                var idGrn = charIDToTypeID( "Grn " );
                desc30.putDouble( idGrn, 0.491516 );
                var idBl = charIDToTypeID( "Bl  " );
                desc30.putDouble( idBl, 0.502616 );
            var idRGBC = charIDToTypeID( "RGBC" );
            desc29.putObject( idClr, idRGBC, desc30 );
        var idFrFX = charIDToTypeID( "FrFX" );
        desc21.putObject( idFrFX, idFrFX, desc29 );
    var idLefx = charIDToTypeID( "Lefx" );
    desc20.putObject( idT, idLefx, desc21 );
executeAction( idsetd, desc20, DialogModes.NO );
    
    //make blue
    //setLayerBlue();
    
    //align centers of layer and doc
    var shapeLayer = docRef.activeLayer;
    shapeLayer.name = "Caption";
    this.centerLayerToDoc(shapeLayer,docRef);

      var textLayer = docRef.artLayers.add();
      
       textLayer.move(shapeLayer,ElementPlacement.PLACEBEFORE);  
        textLayer.kind = LayerKind.TEXT;
             
            var myText = textLayer.textItem;
            
         
            myText.antiAliasMethod=AntiAlias.CRISP;
            myText.kind = TextType.PARAGRAPHTEXT;
               myText.contents = "THIS IS WHERE YOUR CAPTION\rSHOULD GO! YOU CAN RESIZE\rAND WRITE SOMETHING COOL!";
            this.applySizeToChar (myText.contents.length, 42 / docRef.resolution * 72);
            myText.justification = Justification.LEFT;
            
             textLayer.textItem.height = (shapeLayer.bounds[3] - shapeLayer.bounds[1]) / docRef.resolution * 72;
     textLayer.textItem.width = (shapeLayer.bounds[2] - shapeLayer.bounds[0]) / docRef.resolution * 72;
     textLayer.textItem.position = [shapeLayer.bounds[0],shapeLayer.bounds[1]];
       
           
       
           
            
            myText.hyphenation = false;
            
              
            
            myText.color = blackColor;
            
            myText.font = "ComicSansMS";
            myText.justification = Justification.LEFT;
            
            
   myText.height = (textLayer.bounds[3]-textLayer.bounds[1]) / docRef.resolution * 72;
        
      textLayer.translate(50,50+shapeLayer.bounds[1]+(shapeLayer.bounds[3]-shapeLayer.bounds[1])/2.9-textLayer.bounds[1]-
      													(textLayer.bounds[3]-textLayer.bounds[1])/2);
                                                        
  
      //setLayerBlue();
              
    //create group out of these layers
   var newSet = textLayer.parent.layerSets.add();
   newSet.name = "Caption";
   this.setLayerOrange();
        shapeLayer.move(newSet,ElementPlacement.INSIDE);
         textLayer.move(newSet,ElementPlacement.INSIDE);

     docRef.activeLayer = newSet;
     
     break;
    	
    	case "speechRectangle":
        
        try{
           this.createShapeWithText("Talk 12","Type something\rfunny right here!","Speech Rectangle",627-369,1014-262);
    	//this.performFunction("Speech Rectangle",'this.createShapeWithText("Talk 12","Type something\rfunny right here!","Speech Rectangle",627-369,1014-262);');
       }catch(e){alert(e)}
    	break;
    	
    	case "speechOval":
    	
    	this.createShapeWithText("Talk 9","Say something\rthat's really cool\rin this bubble!","Speech Oval",912-372,994-244);
    	break;
    	
    	case "thoughtCloud":
    	this.createShapeWithText("Thought 2","Thinking of\rsomething really\rclever to say!","Thought Cloud",(1105-319)*0.85,(1004-252)*0.85);
    	break;
    	
    	case "speechCloud":
    	this.createShapeWithText("Talk 3","Here you can\rtype something\rreally funny!","Speech Cloud",877-334,974-224);
    	break;
    	
    	case "speechSquare":
    	this.createShapeWithText("Talk 10","Here is where you\rcan write what\rsomeone is saying!","Speech Square",979-339,975-224);
 		break;
 		
 		case "shoutBubble":
 		this.createShapeWithText("Talk 8","Shout some\rfun and clever\rremarks here!","Shout Bubble",841-238,999-249);
    	break;
    	
    	case "speechBubble":
    	this.createShapeWithText("Talk 1","Here you can\rsay something\rfun and clever!","Speech Bubble",612-83,835-85);
  		break;
  		
  		case "thoughtBubble":
  		this.createShapeWithText("Thought 1","Here you can\rtype something\rfun and clever!","Thought Bubble",(847-129)*0.85,(981-230)*0.85);
  		break;
  		
  		case "reverse":
  		   if(!app.documents.length) return;
         var docRef = app.activeDocument;
        docRef.activeLayer.resize(-100,100);
        break;
        
        case "undo":
         if(!app.documents.length) return;
         var docRef = app.activeDocument;
        docRef.activeLayer.remove();
        break;
        
        	case "colorAdjuster":
    	this.performFunction("Color Adjuster",'this.colorAdjuster();');
   //     this.colorAdjuster();
        break;
        
        case "brightnessAdjuster":
    	this.performFunction("Brightness Adjuster",'this.brightnessAdjuster();');
   //     this.colorAdjuster();
        break;
        
        
        case "saturationUp":
        if(!app.documents.length) return;

        
         var docRef = app.activeDocument;
        var currLayer = docRef.activeLayer.duplicate();
        docRef.activeLayer = currLayer;
        this.hueSaturation(0,40,0,false);
        currLayer.name = "More Saturation";
        break;
        
        
        case "saturationDown":
        if(!app.documents.length) return;

        
         var docRef = app.activeDocument;
        var currLayer = docRef.activeLayer.duplicate();
        docRef.activeLayer = currLayer;
        this.hueSaturation(0,-40,0,false);
        currLayer.name = "Less Saturation";
        break;
        
        case "brightnessUp":
          if(!app.documents.length) return;

        
         var docRef = app.activeDocument;
        var currLayer = docRef.activeLayer.duplicate();
        docRef.activeLayer = currLayer;
       
        var desc1 = new ActionDescriptor();
    desc1.putEnumerated(app.stringIDToTypeID("presetKind"), app.stringIDToTypeID("presetKindType"), app.stringIDToTypeID("presetKindCustom"));
    var list1 = new ActionList();
    var desc2 = new ActionDescriptor();
    var ref1 = new ActionReference();
    ref1.putEnumerated(app.charIDToTypeID('Chnl'), app.charIDToTypeID('Chnl'), app.charIDToTypeID('Cmps'));
    desc2.putReference(app.charIDToTypeID('Chnl'), ref1);
    var list2 = new ActionList();
    var desc3 = new ActionDescriptor();
    desc3.putDouble(app.charIDToTypeID('Hrzn'), 0);
    desc3.putDouble(app.charIDToTypeID('Vrtc'), 0);
    list2.putObject(app.charIDToTypeID('Pnt '), desc3);
    var desc4 = new ActionDescriptor();
    desc4.putDouble(app.charIDToTypeID('Hrzn'), 159);
    desc4.putDouble(app.charIDToTypeID('Vrtc'), 219);
    list2.putObject(app.charIDToTypeID('Pnt '), desc4);
    var desc5 = new ActionDescriptor();
    desc5.putDouble(app.charIDToTypeID('Hrzn'), 255);
    desc5.putDouble(app.charIDToTypeID('Vrtc'), 255);
    list2.putObject(app.charIDToTypeID('Pnt '), desc5);
    desc2.putList(app.charIDToTypeID('Crv '), list2);
    list1.putObject(app.charIDToTypeID('CrvA'), desc2);
    desc1.putList(app.charIDToTypeID('Adjs'), list1);
    executeAction(app.charIDToTypeID('Crvs'), desc1, DialogModes.NO);
    
        currLayer.name = "Brighter";
        break;
        
        case "brightnessDown":
         if(!app.documents.length) return;

        
         var docRef = app.activeDocument;
        var currLayer = docRef.activeLayer.duplicate();
        docRef.activeLayer = currLayer;
       
       var desc1 = new ActionDescriptor();
    desc1.putEnumerated(app.stringIDToTypeID("presetKind"), app.stringIDToTypeID("presetKindType"), app.stringIDToTypeID("presetKindCustom"));
    var list1 = new ActionList();
    var desc2 = new ActionDescriptor();
    var ref1 = new ActionReference();
    ref1.putEnumerated(app.charIDToTypeID('Chnl'), app.charIDToTypeID('Chnl'), app.charIDToTypeID('Cmps'));
    desc2.putReference(app.charIDToTypeID('Chnl'), ref1);
    var list2 = new ActionList();
    var desc3 = new ActionDescriptor();
    desc3.putDouble(app.charIDToTypeID('Hrzn'), 0);
    desc3.putDouble(app.charIDToTypeID('Vrtc'), 0);
    list2.putObject(app.charIDToTypeID('Pnt '), desc3);
    var desc4 = new ActionDescriptor();
    desc4.putDouble(app.charIDToTypeID('Hrzn'), 196);
    desc4.putDouble(app.charIDToTypeID('Vrtc'), 167);
    list2.putObject(app.charIDToTypeID('Pnt '), desc4);
    var desc5 = new ActionDescriptor();
    desc5.putDouble(app.charIDToTypeID('Hrzn'), 255);
    desc5.putDouble(app.charIDToTypeID('Vrtc'), 255);
    list2.putObject(app.charIDToTypeID('Pnt '), desc5);
    desc2.putList(app.charIDToTypeID('Crv '), list2);
    list1.putObject(app.charIDToTypeID('CrvA'), desc2);
    desc1.putList(app.charIDToTypeID('Adjs'), list1);
    executeAction(app.charIDToTypeID('Crvs'), desc1, DialogModes.NO);
    
        currLayer.name = "Less Bright";
        break;
        
    case "sketchPad":
     if(!app.documents.length) return;

        
         var docRef = app.activeDocument;
        var currLayer = docRef.activeLayer.duplicate();
        
        docRef.activeLayer = currLayer;
        
        this.hueSaturation(0,-100,0,false);
        var copyLayer = currLayer.duplicate();
         docRef.activeLayer = copyLayer;
         copyLayer.invert();
         copyLayer.blendMode = BlendMode.COLORDODGE;
         copyLayer.applyGaussianBlur(9);
         currLayer = copyLayer.merge();
         
         copyLayer = currLayer.duplicate();
         copyLayer.blendMode = BlendMode.MULTIPLY;
         
         //make 8 copies
         var copyLayers = [];
         for(var i=0;i<7;i++)
            copyLayers.push(copyLayer.duplicate());
         for(var i=0;i<7;i++)
            copyLayers[i].merge();
           
           currLayer = copyLayer.merge();
          copyLayer = currLayer.duplicate();

         copyLayer.applyGaussianBlur(9);
         copyLayer.opacity=15;
         currLayer = copyLayer.merge();
            
     
     currLayer.name = "Sketch";
    break;    
    	
    	case "redBase":
    	if(!app.documents.length) return;
         var oldFront = app.foregroundColor;
        var oldBack = app.backgroundColor;

        this.setSwatches(whiteColor,blackColor);

        
         var docRef = app.activeDocument;
        var currLayer = docRef.activeLayer.duplicate();
        
        currLayer.applySharpen();
        docRef.activeLayer = currLayer;
        
        //filter gallery
            var desc1 = new ActionDescriptor();
    desc1.putEnumerated(app.charIDToTypeID('GEfk'), app.charIDToTypeID('GEft'), app.charIDToTypeID('PstE'));
    desc1.putInteger(app.charIDToTypeID('EdgT'), 7);
    desc1.putInteger(app.charIDToTypeID('EdgI'), 1);
    desc1.putInteger(app.charIDToTypeID('Pstr'), 1);
    executeAction(app.charIDToTypeID('GEfc'), desc1, DialogModes.NO);
    
    this.hueSaturation(0,44,0,false);
    this.brightnessContrast (0,44,false);
    
     var copyLayer = currLayer.duplicate();

      docRef.activeLayer = copyLayer;
      
          var desc1 = new ActionDescriptor();
    desc1.putEnumerated(app.charIDToTypeID('GEfk'), app.charIDToTypeID('GEft'), app.charIDToTypeID('HlfS'));
    desc1.putInteger(app.charIDToTypeID('HlSz'), 2);
    desc1.putInteger(app.charIDToTypeID('Cntr'), 12);
    desc1.putEnumerated(app.charIDToTypeID('ScrT'), app.charIDToTypeID('ScrT'), app.charIDToTypeID('ScrD'));
    executeAction(app.charIDToTypeID('GEfc'), desc1, DialogModes.NO);
    
    copyLayer.invert();
    copyLayer.blendMode = BlendMode.LIGHTEN;
    
    
     
     currLayer = copyLayer.merge();
     
     this.hueSaturation(10,50,0,false);
     
     currLayer.name = "Red Ink Base Comic";

     
     
    
            this.setSwatches(oldFront,oldBack);
            break;
            
            case "redBasePx":
             if(!app.documents.length) return;
        
        var oldFront = app.foregroundColor;
        var oldBack = app.backgroundColor;

        this.setSwatches(whiteColor,blackColor);

        
         var docRef = app.activeDocument;
        var currLayer = docRef.activeLayer;
        
          this.layerToNewDocument ();

    var imageWidth = app.activeDocument.width.value;
    var dupLayer = app.activeDocument.activeLayer;
    
           //scale image 300%
        var idImgS = charIDToTypeID( "ImgS" );
    var desc40 = new ActionDescriptor();
    var idWdth = charIDToTypeID( "Wdth" );
    var idPxl = charIDToTypeID( "#Pxl" );
    desc40.putUnitDouble( idWdth, idPxl, imageWidth * 3 );
    var idscaleStyles = stringIDToTypeID( "scaleStyles" );
    desc40.putBoolean( idscaleStyles, true );
    var idCnsP = charIDToTypeID( "CnsP" );
    desc40.putBoolean( idCnsP, true );
    var idIntr = charIDToTypeID( "Intr" );
    var idIntp = charIDToTypeID( "Intp" );
    var idNrst = charIDToTypeID( "Nrst" );
    desc40.putEnumerated( idIntr, idIntp, idNrst );
executeAction( idImgS, desc40, DialogModes.NO );
        
        dupLayer.applySharpen();

        
        //filter gallery
            var desc1 = new ActionDescriptor();
    desc1.putEnumerated(app.charIDToTypeID('GEfk'), app.charIDToTypeID('GEft'), app.charIDToTypeID('PstE'));
    desc1.putInteger(app.charIDToTypeID('EdgT'), 7);
    desc1.putInteger(app.charIDToTypeID('EdgI'), 1);
    desc1.putInteger(app.charIDToTypeID('Pstr'), 1);
    executeAction(app.charIDToTypeID('GEfc'), desc1, DialogModes.NO);
    
    this.hueSaturation(0,44,0,false);
    this.brightnessContrast (0,44,false);
    
     var copyLayer = dupLayer.duplicate();

      app.activeDocument.activeLayer = copyLayer;
      
          var desc1 = new ActionDescriptor();
    desc1.putEnumerated(app.charIDToTypeID('GEfk'), app.charIDToTypeID('GEft'), app.charIDToTypeID('HlfS'));
    desc1.putInteger(app.charIDToTypeID('HlSz'), 2);
    desc1.putInteger(app.charIDToTypeID('Cntr'), 12);
    desc1.putEnumerated(app.charIDToTypeID('ScrT'), app.charIDToTypeID('ScrT'), app.charIDToTypeID('ScrD'));
    executeAction(app.charIDToTypeID('GEfc'), desc1, DialogModes.NO);
    
    copyLayer.invert();
    copyLayer.blendMode = BlendMode.LIGHTEN;
    
      dupLayer = copyLayer.merge();
    
    this.hueSaturation (10, 50, 0, false);
    
     var idImgS = charIDToTypeID( "ImgS" );
    var desc40 = new ActionDescriptor();
    var idWdth = charIDToTypeID( "Wdth" );
    var idPxl = charIDToTypeID( "#Pxl" );
    desc40.putUnitDouble( idWdth, idPxl, imageWidth );
    var idscaleStyles = stringIDToTypeID( "scaleStyles" );
    desc40.putBoolean( idscaleStyles, true );
    var idCnsP = charIDToTypeID( "CnsP" );
    desc40.putBoolean( idCnsP, true );
    var idIntr = charIDToTypeID( "Intr" );
    var idIntp = charIDToTypeID( "Intp" );
    var idbicubicAutomatic = stringIDToTypeID( "bicubicAutomatic" );
    desc40.putEnumerated( idIntr, idIntp, idbicubicAutomatic );
executeAction( idImgS, desc40, DialogModes.NO );


     
    var myLayer = dupLayer.duplicate(currLayer,ElementPlacement.PLACEBEFORE);
    app.activeDocument.close(SaveOptions.DONOTSAVECHANGES);

    myLayer.name = "Red Ink Base Comic < px";
     

    
            this.setSwatches(oldFront,oldBack);
            break;
            
          case "newsprint":
           if(!app.documents.length) return;
        
        var oldFront = app.foregroundColor;
        var oldBack = app.backgroundColor;

        this.setSwatches(whiteColor,blackColor);

        
         var docRef = app.activeDocument;
        var currLayer = docRef.activeLayer.duplicate();
        
        currLayer.applySharpen();
        docRef.activeLayer = currLayer;
        
        //filter gallery
            var desc1 = new ActionDescriptor();
    desc1.putEnumerated(app.charIDToTypeID('GEfk'), app.charIDToTypeID('GEft'), app.charIDToTypeID('PstE'));
    desc1.putInteger(app.charIDToTypeID('EdgT'), 7);
    desc1.putInteger(app.charIDToTypeID('EdgI'), 1);
    desc1.putInteger(app.charIDToTypeID('Pstr'), 1);
    executeAction(app.charIDToTypeID('GEfc'), desc1, DialogModes.NO);
    
    this.hueSaturation(0,44,0,false);
    this.brightnessContrast (0,44,false);

      
          var desc1 = new ActionDescriptor();
    desc1.putEnumerated(app.charIDToTypeID('GEfk'), app.charIDToTypeID('GEft'), app.charIDToTypeID('HlfS'));
    desc1.putInteger(app.charIDToTypeID('HlSz'), 2);
    desc1.putInteger(app.charIDToTypeID('Cntr'), 12);
    desc1.putEnumerated(app.charIDToTypeID('ScrT'), app.charIDToTypeID('ScrT'), app.charIDToTypeID('ScrD'));
    executeAction(app.charIDToTypeID('GEfc'), desc1, DialogModes.NO);

    currLayer.invert();
    //curves
      var desc1 = new ActionDescriptor();
    desc1.putEnumerated(app.stringIDToTypeID("presetKind"), app.stringIDToTypeID("presetKindType"), app.stringIDToTypeID("presetKindCustom"));
    var list1 = new ActionList();
    var desc2 = new ActionDescriptor();
    var ref1 = new ActionReference();
    ref1.putEnumerated(app.charIDToTypeID('Chnl'), app.charIDToTypeID('Chnl'), app.charIDToTypeID('Cmps'));
    desc2.putReference(app.charIDToTypeID('Chnl'), ref1);
    var list2 = new ActionList();
    var desc3 = new ActionDescriptor();
    desc3.putDouble(app.charIDToTypeID('Hrzn'), 0);
    desc3.putDouble(app.charIDToTypeID('Vrtc'), 0);
    list2.putObject(app.charIDToTypeID('Pnt '), desc3);
    var desc4 = new ActionDescriptor();
    desc4.putDouble(app.charIDToTypeID('Hrzn'), 144);
    desc4.putDouble(app.charIDToTypeID('Vrtc'), 184);
    list2.putObject(app.charIDToTypeID('Pnt '), desc4);
    var desc5 = new ActionDescriptor();
    desc5.putDouble(app.charIDToTypeID('Hrzn'), 255);
    desc5.putDouble(app.charIDToTypeID('Vrtc'), 255);
    list2.putObject(app.charIDToTypeID('Pnt '), desc5);
    desc2.putList(app.charIDToTypeID('Crv '), list2);
    list1.putObject(app.charIDToTypeID('CrvA'), desc2);
    desc1.putList(app.charIDToTypeID('Adjs'), list1);
    executeAction(app.charIDToTypeID('Crvs'), desc1, DialogModes.NO);
    
    //shadow/highlight
    var desc1 = new ActionDescriptor();
    var desc2 = new ActionDescriptor();
    desc2.putUnitDouble(app.charIDToTypeID('Amnt'), app.charIDToTypeID('#Prc'), 35);
    desc2.putUnitDouble(app.charIDToTypeID('Wdth'), app.charIDToTypeID('#Prc'), 50);
    desc2.putInteger(app.charIDToTypeID('Rds '), 30);
    desc1.putObject(app.charIDToTypeID('sdwM'), app.stringIDToTypeID("adaptCorrectTones"), desc2);
    var desc3 = new ActionDescriptor();
    desc3.putUnitDouble(app.charIDToTypeID('Amnt'), app.charIDToTypeID('#Prc'), 0);
    desc3.putUnitDouble(app.charIDToTypeID('Wdth'), app.charIDToTypeID('#Prc'), 50);
    desc3.putInteger(app.charIDToTypeID('Rds '), 30);
    desc1.putObject(app.charIDToTypeID('hglM'), app.stringIDToTypeID("adaptCorrectTones"), desc3);
    desc1.putDouble(app.charIDToTypeID('BlcC'), 0.01);
    desc1.putDouble(app.charIDToTypeID('WhtC'), 0.01);
    desc1.putInteger(app.charIDToTypeID('Cntr'), 0);
    desc1.putInteger(app.charIDToTypeID('ClrC'), 20);
    executeAction(app.stringIDToTypeID('adaptCorrect'), desc1, DialogModes.NO);
     
     currLayer.name = "Newsprint";

     
  
            this.setSwatches(oldFront,oldBack);
            break;  
            
    	case "newsprintPx":
    	if(!app.documents.length) return;
        
        var oldFront = app.foregroundColor;
        var oldBack = app.backgroundColor;

        this.setSwatches(whiteColor,blackColor);

        
         var docRef = app.activeDocument;
        var currLayer = docRef.activeLayer;
        
         var currLayer = docRef.activeLayer;
        
          this.layerToNewDocument();

    var imageWidth = app.activeDocument.width.value;
    var dupLayer = app.activeDocument.activeLayer;
    
           //scale image 300%
        var idImgS = charIDToTypeID( "ImgS" );
    var desc40 = new ActionDescriptor();
    var idWdth = charIDToTypeID( "Wdth" );
    var idPxl = charIDToTypeID( "#Pxl" );
    desc40.putUnitDouble( idWdth, idPxl, imageWidth * 3 );
    var idscaleStyles = stringIDToTypeID( "scaleStyles" );
    desc40.putBoolean( idscaleStyles, true );
    var idCnsP = charIDToTypeID( "CnsP" );
    desc40.putBoolean( idCnsP, true );
    var idIntr = charIDToTypeID( "Intr" );
    var idIntp = charIDToTypeID( "Intp" );
    var idNrst = charIDToTypeID( "Nrst" );
    desc40.putEnumerated( idIntr, idIntp, idNrst );
executeAction( idImgS, desc40, DialogModes.NO );
        
        dupLayer.applySharpen();
        
        //filter gallery
            var desc1 = new ActionDescriptor();
    desc1.putEnumerated(app.charIDToTypeID('GEfk'), app.charIDToTypeID('GEft'), app.charIDToTypeID('PstE'));
    desc1.putInteger(app.charIDToTypeID('EdgT'), 7);
    desc1.putInteger(app.charIDToTypeID('EdgI'), 1);
    desc1.putInteger(app.charIDToTypeID('Pstr'), 1);
    executeAction(app.charIDToTypeID('GEfc'), desc1, DialogModes.NO);
    
    this.hueSaturation(0,44,0,false);
    this.brightnessContrast (0,44,false);

      
          var desc1 = new ActionDescriptor();
    desc1.putEnumerated(app.charIDToTypeID('GEfk'), app.charIDToTypeID('GEft'), app.charIDToTypeID('HlfS'));
    desc1.putInteger(app.charIDToTypeID('HlSz'), 2);
    desc1.putInteger(app.charIDToTypeID('Cntr'), 12);
    desc1.putEnumerated(app.charIDToTypeID('ScrT'), app.charIDToTypeID('ScrT'), app.charIDToTypeID('ScrD'));
    executeAction(app.charIDToTypeID('GEfc'), desc1, DialogModes.NO);

    dupLayer.invert();
    //curves
      var desc1 = new ActionDescriptor();
    desc1.putEnumerated(app.stringIDToTypeID("presetKind"), app.stringIDToTypeID("presetKindType"), app.stringIDToTypeID("presetKindCustom"));
    var list1 = new ActionList();
    var desc2 = new ActionDescriptor();
    var ref1 = new ActionReference();
    ref1.putEnumerated(app.charIDToTypeID('Chnl'), app.charIDToTypeID('Chnl'), app.charIDToTypeID('Cmps'));
    desc2.putReference(app.charIDToTypeID('Chnl'), ref1);
    var list2 = new ActionList();
    var desc3 = new ActionDescriptor();
    desc3.putDouble(app.charIDToTypeID('Hrzn'), 0);
    desc3.putDouble(app.charIDToTypeID('Vrtc'), 0);
    list2.putObject(app.charIDToTypeID('Pnt '), desc3);
    var desc4 = new ActionDescriptor();
    desc4.putDouble(app.charIDToTypeID('Hrzn'), 144);
    desc4.putDouble(app.charIDToTypeID('Vrtc'), 184);
    list2.putObject(app.charIDToTypeID('Pnt '), desc4);
    var desc5 = new ActionDescriptor();
    desc5.putDouble(app.charIDToTypeID('Hrzn'), 255);
    desc5.putDouble(app.charIDToTypeID('Vrtc'), 255);
    list2.putObject(app.charIDToTypeID('Pnt '), desc5);
    desc2.putList(app.charIDToTypeID('Crv '), list2);
    list1.putObject(app.charIDToTypeID('CrvA'), desc2);
    desc1.putList(app.charIDToTypeID('Adjs'), list1);
    executeAction(app.charIDToTypeID('Crvs'), desc1, DialogModes.NO);
    
    //shadow/highlight
    var desc1 = new ActionDescriptor();
    var desc2 = new ActionDescriptor();
    desc2.putUnitDouble(app.charIDToTypeID('Amnt'), app.charIDToTypeID('#Prc'), 35);
    desc2.putUnitDouble(app.charIDToTypeID('Wdth'), app.charIDToTypeID('#Prc'), 50);
    desc2.putInteger(app.charIDToTypeID('Rds '), 30);
    desc1.putObject(app.charIDToTypeID('sdwM'), app.stringIDToTypeID("adaptCorrectTones"), desc2);
    var desc3 = new ActionDescriptor();
    desc3.putUnitDouble(app.charIDToTypeID('Amnt'), app.charIDToTypeID('#Prc'), 0);
    desc3.putUnitDouble(app.charIDToTypeID('Wdth'), app.charIDToTypeID('#Prc'), 50);
    desc3.putInteger(app.charIDToTypeID('Rds '), 30);
    desc1.putObject(app.charIDToTypeID('hglM'), app.stringIDToTypeID("adaptCorrectTones"), desc3);
    desc1.putDouble(app.charIDToTypeID('BlcC'), 0.01);
    desc1.putDouble(app.charIDToTypeID('WhtC'), 0.01);
    desc1.putInteger(app.charIDToTypeID('Cntr'), 0);
    desc1.putInteger(app.charIDToTypeID('ClrC'), 20);
    executeAction(app.stringIDToTypeID('adaptCorrect'), desc1, DialogModes.NO);
    
    var idImgS = charIDToTypeID( "ImgS" );
    var desc40 = new ActionDescriptor();
    var idWdth = charIDToTypeID( "Wdth" );
    var idPxl = charIDToTypeID( "#Pxl" );
    desc40.putUnitDouble( idWdth, idPxl, imageWidth );
    var idscaleStyles = stringIDToTypeID( "scaleStyles" );
    desc40.putBoolean( idscaleStyles, true );
    var idCnsP = charIDToTypeID( "CnsP" );
    desc40.putBoolean( idCnsP, true );
    var idIntr = charIDToTypeID( "Intr" );
    var idIntp = charIDToTypeID( "Intp" );
    var idbicubicAutomatic = stringIDToTypeID( "bicubicAutomatic" );
    desc40.putEnumerated( idIntr, idIntp, idbicubicAutomatic );
executeAction( idImgS, desc40, DialogModes.NO );
     
    var myLayer = dupLayer.duplicate(currLayer,ElementPlacement.PLACEBEFORE);
    app.activeDocument.close(SaveOptions.DONOTSAVECHANGES);
     
     myLayer.name = "Newsprint < px";


            this.setSwatches(oldFront,oldBack);
    	break;
    	
    	
    	case "comic":
    	 if(!app.documents.length) return;
        
        var oldFront = app.foregroundColor;
        var oldBack = app.backgroundColor;

        this.setSwatches(whiteColor,blackColor);

        
         var docRef = app.activeDocument;
        var currLayer = docRef.activeLayer.duplicate();
        
        currLayer.applySharpen();
        docRef.activeLayer = currLayer;
        
        //filter gallery
            var desc1 = new ActionDescriptor();
    desc1.putEnumerated(app.charIDToTypeID('GEfk'), app.charIDToTypeID('GEft'), app.charIDToTypeID('PstE'));
    desc1.putInteger(app.charIDToTypeID('EdgT'), 7);
    desc1.putInteger(app.charIDToTypeID('EdgI'), 1);
    desc1.putInteger(app.charIDToTypeID('Pstr'), 1);
    executeAction(app.charIDToTypeID('GEfc'), desc1, DialogModes.NO);
    
    this.hueSaturation(0,44,0,false);
    this.brightnessContrast (0,44,false);
    
     var copyLayer = currLayer.duplicate();

      docRef.activeLayer = copyLayer;
      
          var desc1 = new ActionDescriptor();
    desc1.putEnumerated(app.charIDToTypeID('GEfk'), app.charIDToTypeID('GEft'), app.charIDToTypeID('HlfS'));
    desc1.putInteger(app.charIDToTypeID('HlSz'), 2);
    desc1.putInteger(app.charIDToTypeID('Cntr'), 12);
    desc1.putEnumerated(app.charIDToTypeID('ScrT'), app.charIDToTypeID('ScrT'), app.charIDToTypeID('ScrD'));
    executeAction(app.charIDToTypeID('GEfc'), desc1, DialogModes.NO);
    
    copyLayer.invert();
    copyLayer.blendMode = BlendMode.LUMINOSITY;
    
    //curves
      var desc1 = new ActionDescriptor();
    desc1.putEnumerated(app.stringIDToTypeID("presetKind"), app.stringIDToTypeID("presetKindType"), app.stringIDToTypeID("presetKindCustom"));
    var list1 = new ActionList();
    var desc2 = new ActionDescriptor();
    var ref1 = new ActionReference();
    ref1.putEnumerated(app.charIDToTypeID('Chnl'), app.charIDToTypeID('Chnl'), app.charIDToTypeID('Cmps'));
    desc2.putReference(app.charIDToTypeID('Chnl'), ref1);
    var list2 = new ActionList();
    var desc3 = new ActionDescriptor();
    desc3.putDouble(app.charIDToTypeID('Hrzn'), 0);
    desc3.putDouble(app.charIDToTypeID('Vrtc'), 0);
    list2.putObject(app.charIDToTypeID('Pnt '), desc3);
    var desc4 = new ActionDescriptor();
    desc4.putDouble(app.charIDToTypeID('Hrzn'), 143);
    desc4.putDouble(app.charIDToTypeID('Vrtc'), 180);
    list2.putObject(app.charIDToTypeID('Pnt '), desc4);
    var desc5 = new ActionDescriptor();
    desc5.putDouble(app.charIDToTypeID('Hrzn'), 255);
    desc5.putDouble(app.charIDToTypeID('Vrtc'), 255);
    list2.putObject(app.charIDToTypeID('Pnt '), desc5);
    desc2.putList(app.charIDToTypeID('Crv '), list2);
    list1.putObject(app.charIDToTypeID('CrvA'), desc2);
    desc1.putList(app.charIDToTypeID('Adjs'), list1);
    executeAction(app.charIDToTypeID('Crvs'), desc1, DialogModes.NO);
    
    //shadow/highlight
    var desc1 = new ActionDescriptor();
    var desc2 = new ActionDescriptor();
    desc2.putUnitDouble(app.charIDToTypeID('Amnt'), app.charIDToTypeID('#Prc'), 35);
    desc2.putUnitDouble(app.charIDToTypeID('Wdth'), app.charIDToTypeID('#Prc'), 50);
    desc2.putInteger(app.charIDToTypeID('Rds '), 30);
    desc1.putObject(app.charIDToTypeID('sdwM'), app.stringIDToTypeID("adaptCorrectTones"), desc2);
    var desc3 = new ActionDescriptor();
    desc3.putUnitDouble(app.charIDToTypeID('Amnt'), app.charIDToTypeID('#Prc'), 0);
    desc3.putUnitDouble(app.charIDToTypeID('Wdth'), app.charIDToTypeID('#Prc'), 50);
    desc3.putInteger(app.charIDToTypeID('Rds '), 30);
    desc1.putObject(app.charIDToTypeID('hglM'), app.stringIDToTypeID("adaptCorrectTones"), desc3);
    desc1.putDouble(app.charIDToTypeID('BlcC'), 0.01);
    desc1.putDouble(app.charIDToTypeID('WhtC'), 0.01);
    desc1.putInteger(app.charIDToTypeID('Cntr'), 0);
    desc1.putInteger(app.charIDToTypeID('ClrC'), 20);
    executeAction(app.stringIDToTypeID('adaptCorrect'), desc1, DialogModes.NO);
     
     currLayer = copyLayer.merge();
     currLayer.applySharpen();
     currLayer.name = "Comic";

     
     
    
            this.setSwatches(oldFront,oldBack);
    	break;
    	
    	case "comicPx":
    	 if(!app.documents.length) return;
        
        var oldFront = app.foregroundColor;
        var oldBack = app.backgroundColor;

        this.setSwatches(whiteColor,blackColor);

        
         var docRef = app.activeDocument;
        var currLayer = docRef.activeLayer;
        
          this.layerToNewDocument ();

    var imageWidth = app.activeDocument.width.value;
    var dupLayer = app.activeDocument.activeLayer;
    
           //scale image 300%
        var idImgS = charIDToTypeID( "ImgS" );
    var desc40 = new ActionDescriptor();
    var idWdth = charIDToTypeID( "Wdth" );
    var idPxl = charIDToTypeID( "#Pxl" );
    desc40.putUnitDouble( idWdth, idPxl, imageWidth * 3 );
    var idscaleStyles = stringIDToTypeID( "scaleStyles" );
    desc40.putBoolean( idscaleStyles, true );
    var idCnsP = charIDToTypeID( "CnsP" );
    desc40.putBoolean( idCnsP, true );
    var idIntr = charIDToTypeID( "Intr" );
    var idIntp = charIDToTypeID( "Intp" );
    var idNrst = charIDToTypeID( "Nrst" );
    desc40.putEnumerated( idIntr, idIntp, idNrst );
executeAction( idImgS, desc40, DialogModes.NO );
        
        dupLayer.applySharpen();

        
        //filter gallery
            var desc1 = new ActionDescriptor();
    desc1.putEnumerated(app.charIDToTypeID('GEfk'), app.charIDToTypeID('GEft'), app.charIDToTypeID('PstE'));
    desc1.putInteger(app.charIDToTypeID('EdgT'), 7);
    desc1.putInteger(app.charIDToTypeID('EdgI'), 1);
    desc1.putInteger(app.charIDToTypeID('Pstr'), 1);
    executeAction(app.charIDToTypeID('GEfc'), desc1, DialogModes.NO);
    
    this.hueSaturation(0,44,0,false);
    this.brightnessContrast (0,44,false);
    
     var copyLayer = dupLayer.duplicate();

      app.activeDocument.activeLayer = copyLayer;
      
          var desc1 = new ActionDescriptor();
    desc1.putEnumerated(app.charIDToTypeID('GEfk'), app.charIDToTypeID('GEft'), app.charIDToTypeID('HlfS'));
    desc1.putInteger(app.charIDToTypeID('HlSz'), 2);
    desc1.putInteger(app.charIDToTypeID('Cntr'), 12);
    desc1.putEnumerated(app.charIDToTypeID('ScrT'), app.charIDToTypeID('ScrT'), app.charIDToTypeID('ScrD'));
    executeAction(app.charIDToTypeID('GEfc'), desc1, DialogModes.NO);
    
    copyLayer.invert();
    copyLayer.blendMode = BlendMode.LUMINOSITY;
    
    //curves
      var desc1 = new ActionDescriptor();
    desc1.putEnumerated(app.stringIDToTypeID("presetKind"), app.stringIDToTypeID("presetKindType"), app.stringIDToTypeID("presetKindCustom"));
    var list1 = new ActionList();
    var desc2 = new ActionDescriptor();
    var ref1 = new ActionReference();
    ref1.putEnumerated(app.charIDToTypeID('Chnl'), app.charIDToTypeID('Chnl'), app.charIDToTypeID('Cmps'));
    desc2.putReference(app.charIDToTypeID('Chnl'), ref1);
    var list2 = new ActionList();
    var desc3 = new ActionDescriptor();
    desc3.putDouble(app.charIDToTypeID('Hrzn'), 0);
    desc3.putDouble(app.charIDToTypeID('Vrtc'), 0);
    list2.putObject(app.charIDToTypeID('Pnt '), desc3);
    var desc4 = new ActionDescriptor();
    desc4.putDouble(app.charIDToTypeID('Hrzn'), 143);
    desc4.putDouble(app.charIDToTypeID('Vrtc'), 180);
    list2.putObject(app.charIDToTypeID('Pnt '), desc4);
    var desc5 = new ActionDescriptor();
    desc5.putDouble(app.charIDToTypeID('Hrzn'), 255);
    desc5.putDouble(app.charIDToTypeID('Vrtc'), 255);
    list2.putObject(app.charIDToTypeID('Pnt '), desc5);
    desc2.putList(app.charIDToTypeID('Crv '), list2);
    list1.putObject(app.charIDToTypeID('CrvA'), desc2);
    desc1.putList(app.charIDToTypeID('Adjs'), list1);
    executeAction(app.charIDToTypeID('Crvs'), desc1, DialogModes.NO);
    
    //shadow/highlight
    var desc1 = new ActionDescriptor();
    var desc2 = new ActionDescriptor();
    desc2.putUnitDouble(app.charIDToTypeID('Amnt'), app.charIDToTypeID('#Prc'), 35);
    desc2.putUnitDouble(app.charIDToTypeID('Wdth'), app.charIDToTypeID('#Prc'), 50);
    desc2.putInteger(app.charIDToTypeID('Rds '), 30);
    desc1.putObject(app.charIDToTypeID('sdwM'), app.stringIDToTypeID("adaptCorrectTones"), desc2);
    var desc3 = new ActionDescriptor();
    desc3.putUnitDouble(app.charIDToTypeID('Amnt'), app.charIDToTypeID('#Prc'), 0);
    desc3.putUnitDouble(app.charIDToTypeID('Wdth'), app.charIDToTypeID('#Prc'), 50);
    desc3.putInteger(app.charIDToTypeID('Rds '), 30);
    desc1.putObject(app.charIDToTypeID('hglM'), app.stringIDToTypeID("adaptCorrectTones"), desc3);
    desc1.putDouble(app.charIDToTypeID('BlcC'), 0.01);
    desc1.putDouble(app.charIDToTypeID('WhtC'), 0.01);
    desc1.putInteger(app.charIDToTypeID('Cntr'), 0);
    desc1.putInteger(app.charIDToTypeID('ClrC'), 20);
    executeAction(app.stringIDToTypeID('adaptCorrect'), desc1, DialogModes.NO);
    
     var idImgS = charIDToTypeID( "ImgS" );
    var desc40 = new ActionDescriptor();
    var idWdth = charIDToTypeID( "Wdth" );
    var idPxl = charIDToTypeID( "#Pxl" );
    desc40.putUnitDouble( idWdth, idPxl, imageWidth );
    var idscaleStyles = stringIDToTypeID( "scaleStyles" );
    desc40.putBoolean( idscaleStyles, true );
    var idCnsP = charIDToTypeID( "CnsP" );
    desc40.putBoolean( idCnsP, true );
    var idIntr = charIDToTypeID( "Intr" );
    var idIntp = charIDToTypeID( "Intp" );
    var idbicubicAutomatic = stringIDToTypeID( "bicubicAutomatic" );
    desc40.putEnumerated( idIntr, idIntp, idbicubicAutomatic );
executeAction( idImgS, desc40, DialogModes.NO );

    dupLayer = copyLayer.merge();
     
    var myLayer = dupLayer.duplicate(currLayer,ElementPlacement.PLACEBEFORE);
    app.activeDocument.close(SaveOptions.DONOTSAVECHANGES);

    myLayer.name = "Comic < px";
     

     
     
    
            this.setSwatches(oldFront,oldBack);
    	break;
    	
    	case "cartoon":
    	if(!app.documents.length) return;
        
        var oldFront = app.foregroundColor;
        var oldBack = app.backgroundColor;

        this.setSwatches(blackColor,whiteColor);

        
         var docRef = app.activeDocument;
        var currLayer = docRef.activeLayer.duplicate();
        currLayer.name = "Cartoon";
        currLayer.applySharpen();
        docRef.activeLayer = currLayer;
        
        //filter gallery
            var desc1 = new ActionDescriptor();
    desc1.putEnumerated(app.charIDToTypeID('GEfk'), app.charIDToTypeID('GEft'), app.charIDToTypeID('PstE'));
    desc1.putInteger(app.charIDToTypeID('EdgT'), 7);
    desc1.putInteger(app.charIDToTypeID('EdgI'), 1);
    desc1.putInteger(app.charIDToTypeID('Pstr'), 1);
    executeAction(app.charIDToTypeID('GEfc'), desc1, DialogModes.NO);
    
    this.hueSaturation(0,44,0,false);
    this.brightnessContrast (0,44,false);
    
            this.setSwatches(oldFront,oldBack);
            break;
            
          case "cartoonPx":
           if(!app.documents.length) return;
        
                var oldFront = app.foregroundColor;
        var oldBack = app.backgroundColor;

        this.setSwatches(blackColor,whiteColor);
        
         var docRef = app.activeDocument;
        var currLayer = docRef.activeLayer;
        

    this.layerToNewDocument ();

    var imageWidth = app.activeDocument.width.value;
    var dupLayer = app.activeDocument.activeLayer;
    
           //scale image 300%
        var idImgS = charIDToTypeID( "ImgS" );
    var desc40 = new ActionDescriptor();
    var idWdth = charIDToTypeID( "Wdth" );
    var idPxl = charIDToTypeID( "#Pxl" );
    desc40.putUnitDouble( idWdth, idPxl, imageWidth * 3 );
    var idscaleStyles = stringIDToTypeID( "scaleStyles" );
    desc40.putBoolean( idscaleStyles, true );
    var idCnsP = charIDToTypeID( "CnsP" );
    desc40.putBoolean( idCnsP, true );
    var idIntr = charIDToTypeID( "Intr" );
    var idIntp = charIDToTypeID( "Intp" );
    var idNrst = charIDToTypeID( "Nrst" );
    desc40.putEnumerated( idIntr, idIntp, idNrst );
executeAction( idImgS, desc40, DialogModes.NO );

        
           dupLayer.applySharpen();

        //filter gallery
            var desc1 = new ActionDescriptor();
    desc1.putEnumerated(app.charIDToTypeID('GEfk'), app.charIDToTypeID('GEft'), app.charIDToTypeID('PstE'));
    desc1.putInteger(app.charIDToTypeID('EdgT'), 7);
    desc1.putInteger(app.charIDToTypeID('EdgI'), 1);
    desc1.putInteger(app.charIDToTypeID('Pstr'), 1);
    executeAction(app.charIDToTypeID('GEfc'), desc1, DialogModes.NO);
    
    this.hueSaturation(0,44,0,false);
    this.brightnessContrast (0,44,false); 

            var idImgS = charIDToTypeID( "ImgS" );
    var desc40 = new ActionDescriptor();
    var idWdth = charIDToTypeID( "Wdth" );
    var idPxl = charIDToTypeID( "#Pxl" );
    desc40.putUnitDouble( idWdth, idPxl, imageWidth );
    var idscaleStyles = stringIDToTypeID( "scaleStyles" );
    desc40.putBoolean( idscaleStyles, true );
    var idCnsP = charIDToTypeID( "CnsP" );
    desc40.putBoolean( idCnsP, true );
    var idIntr = charIDToTypeID( "Intr" );
    var idIntp = charIDToTypeID( "Intp" );
    var idbicubicAutomatic = stringIDToTypeID( "bicubicAutomatic" );
    desc40.putEnumerated( idIntr, idIntp, idbicubicAutomatic );
executeAction( idImgS, desc40, DialogModes.NO );
         
    var myLayer = dupLayer.duplicate(currLayer,ElementPlacement.PLACEBEFORE);
    app.activeDocument.close(SaveOptions.DONOTSAVECHANGES);

    myLayer.name = "Cartoon < px";
    
                this.setSwatches(oldFront,oldBack);
                break;  
            
            
    	
    	}
    	
    	}catch(e){alert(e)}
    	
    },
    
    
    setSwatches: function(front,back)
{
        app.foregroundColor = front;
        app.backgroundColor = back;
},

layerToNewDocument:function()
{
        var idMk = charIDToTypeID( "Mk  " );
    var desc43 = new ActionDescriptor();
    var idnull = charIDToTypeID( "null" );
        var ref37 = new ActionReference();
        var idDcmn = charIDToTypeID( "Dcmn" );
        ref37.putClass( idDcmn );
    desc43.putReference( idnull, ref37 );
    var idUsng = charIDToTypeID( "Usng" );
        var ref38 = new ActionReference();
        var idLyr = charIDToTypeID( "Lyr " );
        var idOrdn = charIDToTypeID( "Ordn" );
        var idTrgt = charIDToTypeID( "Trgt" );
        ref38.putEnumerated( idLyr, idOrdn, idTrgt );
    desc43.putReference( idUsng, ref38 );
    var idVrsn = charIDToTypeID( "Vrsn" );
    desc43.putInteger( idVrsn, 5 );
executeAction( idMk, desc43, DialogModes.NO );
},

brightnessContrast:function(b,c,l)
{
        try{
                var desc1 = new ActionDescriptor();
    desc1.putInteger(app.charIDToTypeID('Brgh'), b);
    desc1.putInteger(app.charIDToTypeID('Cntr'), c);
    desc1.putBoolean(app.stringIDToTypeID("useLegacy"), l);
    executeAction(app.stringIDToTypeID('brightnessEvent'), desc1, DialogModes.NO);
            }catch(e){}
    
},

hueSaturation:function(h,s,l,c)
{
    try{
        var idHStr = charIDToTypeID( "HStr" );
    var desc14 = new ActionDescriptor();
    var idpresetKind = stringIDToTypeID( "presetKind" );
    var idpresetKindType = stringIDToTypeID( "presetKindType" );
    var idpresetKindCustom = stringIDToTypeID( "presetKindCustom" );
    desc14.putEnumerated( idpresetKind, idpresetKindType, idpresetKindCustom );
    var idClrz = charIDToTypeID( "Clrz" );
    desc14.putBoolean( idClrz, c );
    var idAdjs = charIDToTypeID( "Adjs" );
        var list1 = new ActionList();
            var desc15 = new ActionDescriptor();
            var idH = charIDToTypeID( "H   " );
            desc15.putInteger( idH, h );
            var idStrt = charIDToTypeID( "Strt" );
            desc15.putInteger( idStrt, s );
            var idLght = charIDToTypeID( "Lght" );
            desc15.putInteger( idLght, l );
        var idHsttwo = charIDToTypeID( "Hst2" );
        list1.putObject( idHsttwo, desc15 );
    desc14.putList( idAdjs, list1 );
executeAction( idHStr, desc14, DialogModes.NO );
        }catch(e){}

},

performFunction:function(name,func)
{
    app.displayDialogs = DialogModes.NO;
    var myOldPrefs=app.preferences.rulerUnits;
    app.preferences.rulerUnits=Units.PIXELS;

    if(app.documents.length)
    try{
        app.activeDocument.suspendHistory (name, func);
    }catch(e){}
    
    app.preferences.rulerUnits = myOldPrefs;
},


convertToSmartObject:function()
{
try{
if(app.activeDocument.activeLayer.kind!=LayerKind.SMARTOBJECT)    
executeAction( stringIDToTypeID( "newPlacedLayer" ), undefined, DialogModes.NO );
}catch(e){}
    
},

  createHSLlayer : function(hue,saturation,lightness)
{
    
   var desc = new ActionDescriptor();
var ref1 = new ActionReference();
ref1.putClass( charIDToTypeID('AdjL') );
desc.putReference( charIDToTypeID('null'), ref1 );
var desc2 = new ActionDescriptor();
var desc3 = new ActionDescriptor();
desc3.putEnumerated( stringIDToTypeID('presetKind'), stringIDToTypeID('presetKindType'), stringIDToTypeID('presetKindDefault') );
desc3.putBoolean( charIDToTypeID('Clrz'), false );
desc2.putObject( charIDToTypeID('Type'), charIDToTypeID('HStr'), desc3 );

        var idNm = charIDToTypeID( "Nm  " );
        desc2.putString( idNm, "Color Adjust" );
        var idGrup = charIDToTypeID( "Grup" );
        desc2.putBoolean( idGrup, true );

desc.putObject( charIDToTypeID('Usng'), charIDToTypeID('AdjL'), desc2 );
executeAction( charIDToTypeID('Mk  '), desc, DialogModes.NO );

var desc10 = new ActionDescriptor();
var ref4 = new ActionReference();
ref4.putEnumerated( charIDToTypeID('AdjL'), charIDToTypeID('Ordn'), charIDToTypeID('Trgt') );
desc10.putReference( charIDToTypeID('null'), ref4 );
var desc11 = new ActionDescriptor();
var list2 = new ActionList();
var desc12 = new ActionDescriptor();
desc12.putInteger( charIDToTypeID('H   '), hue );
desc12.putInteger( charIDToTypeID('Strt'), saturation );
desc12.putInteger( charIDToTypeID('Lght'), lightness );
list2.putObject( charIDToTypeID('Hst2'), desc12 );
desc11.putList( charIDToTypeID('Adjs'), list2 );    
desc10.putObject( charIDToTypeID('T   '), charIDToTypeID('HStr'), desc11 );
executeAction( charIDToTypeID('setd'), desc10, DialogModes.ALL );

        },
    
    
applySizeToChar:function(pos, size)
{
    try{
// =======================================================
var idsetd = charIDToTypeID( "setd" );
    var desc159 = new ActionDescriptor();
    var idnull = charIDToTypeID( "null" );
        var ref8 = new ActionReference();
        var idTxLr = charIDToTypeID( "TxLr" );
        var idOrdn = charIDToTypeID( "Ordn" );
        var idTrgt = charIDToTypeID( "Trgt" );
        ref8.putEnumerated( idTxLr, idOrdn, idTrgt );
    desc159.putReference( idnull, ref8 );
    var idT = charIDToTypeID( "T   " );
        var desc160 = new ActionDescriptor();
        
        var idTxtt = charIDToTypeID( "Txtt" );
            var list22 = new ActionList();
                var desc166 = new ActionDescriptor();
                var idFrom = charIDToTypeID( "From" );
                desc166.putInteger( idFrom, 0 );
                var idT = charIDToTypeID( "T   " );
                desc166.putInteger( idT, pos);
                var idTxtS = charIDToTypeID( "TxtS" );
                    var desc167 = new ActionDescriptor();
                    
                    var idSz = charIDToTypeID( "Sz  " );
                    var idPnt = charIDToTypeID( "#Pnt" );
                    desc167.putUnitDouble( idSz, idPnt, size );
                    
                var idTxtS = charIDToTypeID( "TxtS" );
                desc166.putObject( idTxtS, idTxtS, desc167 );
            var idTxtt = charIDToTypeID( "Txtt" );
            list22.putObject( idTxtt, desc166 );

        desc160.putList( idTxtt, list22 );
  
    var idTxLr = charIDToTypeID( "TxLr" );
    desc159.putObject( idT, idTxLr, desc160 );
executeAction( idsetd, desc159, DialogModes.NO );    
}catch(e){log(e)}

}


};



