Welcome Dialog

Welcome to the Community!

We have a brand new look! Take a tour with us and explore the latest updates on Adobe Support Community.


Check if selected area is empty

Contributor ,
Aug 16, 2021 Aug 16, 2021

Copy link to clipboard

Copied

I am trying to create a script that will be executed based on whether the decision is true.  I want to add adjustment curve for each channel particularly (CMYK), only if that color exists on selected layer. It should look like on image below.

Thanks in advanced

Screenshot 2021-08-17 at 12.08.41.png

TOPICS
Actions and scripting, macOS, SDK

Views

143

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Contributor , Aug 17, 2021 Aug 17, 2021

Likes

Translate

Translate
Contributor ,
Aug 17, 2021 Aug 17, 2021

Copy link to clipboard

Copied

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Aug 17, 2021 Aug 17, 2021

Copy link to clipboard

Copied

Can you explain how that solution solves your problem if you look for empty channels, not layers?

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Aug 19, 2021 Aug 19, 2021

Copy link to clipboard

Copied

First I created curves with selection of each channel separately, then I used this script from the link to check each of those four (curve) layers and it works...

It may not be the most aesthetically pleasing solution, but for me as someone who is just researching scripting, it was enough that this script cover my needs 🙂

 

 

 

var layer = app.activeDocument.activeLayer;
var layerName = layer.name;
if (!(layer.allLocked || layer.pixelsLocked || layer.positionLocked || layer.transparentPixelsLocked || (0 !== layer.linkedLayers.length))) { 
    if ((0 === layer.bounds[2] && (0 === layer.bounds[3]))) {
        layer.remove();
    }
    else {
////// do something
 } 
}

 

 

 

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Aug 19, 2021 Aug 19, 2021

Copy link to clipboard

Copied

Your last post content is opposed to your original description.

 

You have written that you want the Curve Adjustment Layers to be created based on the color of the channel in the selected area of the layer.

 

After I couldn't compare linked code (which does something different than you wanted) to your goal I asked how you achieved that.

 

Now you say you don't want curves were created when specific layer area is empty, but you create them in first instance to remove when they have no colour contained in the layer.

 

Anyway due to your last post and earlier pasted image I tried to do it and I can't repeat it.

 

I created CMYK document with black, cmyk and white, and tried to do exactly what you do (also what is not on the image, ie. createing Magenta and Yellow curves layers, both masked and clipped). I used the script on each such curves layer, but it did not delete any of them.

 

Could you please attach your starting .psd file to let me try it with the script you found?

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Aug 23, 2021 Aug 23, 2021

Copy link to clipboard

Copied

Here is psd file... I forgot to add one more closing bracket at the end, code is correct now...

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Aug 23, 2021 Aug 23, 2021

Copy link to clipboard

Copied

I'm sorry, I meant .psd with created adjustement layers, so please upload it again 😉

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Aug 23, 2021 Aug 23, 2021

Copy link to clipboard

Copied

LATEST

This is my code... I only removed parts which adjust curves, i cant share that because of my company policy... As i said earlier it may not be the most aesthetically pleasing solution (don t laugh 😄 ), but it cover my needs...

Try to aplly this script on current psd.

 

app.activeDocument.activeLayer.isBackgroundLayer = false;
    app.activeDocument.activeLayer.locked = false;
    var idCpTL = charIDToTypeID( "CpTL" );
    executeAction( idCpTL, undefined, DialogModes.NO );
    var idCpTL = charIDToTypeID( "CpTL" );
    executeAction( idCpTL, undefined, DialogModes.NO );
    //--------------------------------
    var idFl = charIDToTypeID( "Fl  " );
    var desc269 = new ActionDescriptor();
    var idUsng = charIDToTypeID( "Usng" );
    var idFlCn = charIDToTypeID( "FlCn" );
    var idWht = charIDToTypeID( "Wht " );
    desc269.putEnumerated( idUsng, idFlCn, idWht );
    var idOpct = charIDToTypeID( "Opct" );
    var idPrc = charIDToTypeID( "#Prc" );
    desc269.putUnitDouble( idOpct, idPrc, 100.000000 );
    var idMd = charIDToTypeID( "Md  " );
    var idBlnM = charIDToTypeID( "BlnM" );
    var idNrml = charIDToTypeID( "Nrml" );
    desc269.putEnumerated( idMd, idBlnM, idNrml );
    executeAction( idFl, desc269, DialogModes.NO );
    
    // =======================================================
    var idsetd = charIDToTypeID( "setd" );
    var desc275 = new ActionDescriptor();
    var idnull = charIDToTypeID( "null" );
    var ref93 = new ActionReference();
    var idLyr = charIDToTypeID( "Lyr " );
    var idOrdn = charIDToTypeID( "Ordn" );
    var idTrgt = charIDToTypeID( "Trgt" );
    ref93.putEnumerated( idLyr, idOrdn, idTrgt );
    desc275.putReference( idnull, ref93 );
    var idT = charIDToTypeID( "T   " );
    var desc276 = new ActionDescriptor();
    var idMd = charIDToTypeID( "Md  " );
    var idBlnM = charIDToTypeID( "BlnM" );
    var idDrkn = charIDToTypeID( "Drkn" );
    desc276.putEnumerated( idMd, idBlnM, idDrkn );
    var idLyr = charIDToTypeID( "Lyr " );
    desc275.putObject( idT, idLyr, desc276 );
    executeAction( idsetd, desc275, DialogModes.NO );
    
    //merge two
    var idMrgtwo = charIDToTypeID( "Mrg2" );
    var desc64 = new ActionDescriptor();
    executeAction( idMrgtwo, desc64, DialogModes.NO );
    
    var idMk = charIDToTypeID( "Mk  " );
    var desc418 = new ActionDescriptor();
    var idnull = charIDToTypeID( "null" );
    var ref132 = new ActionReference();
    var idAdjL = charIDToTypeID( "AdjL" );
    ref132.putClass( idAdjL );
    desc418.putReference( idnull, ref132 );
    var idUsng = charIDToTypeID( "Usng" );
    var desc419 = new ActionDescriptor();
    var idType = charIDToTypeID( "Type" );
    var desc420 = new ActionDescriptor();
    var idpresetKind = stringIDToTypeID( "presetKind" );
    var idpresetKindType = stringIDToTypeID( "presetKindType" );
    var idpresetKindDefault = stringIDToTypeID( "presetKindDefault" );
    desc420.putEnumerated( idpresetKind, idpresetKindType, idpresetKindDefault );
    var idCrvs = charIDToTypeID( "Crvs" );
    desc419.putObject( idType, idCrvs, desc420 );
    var idAdjL = charIDToTypeID( "AdjL" );
    desc418.putObject( idUsng, idAdjL, desc419 );
    executeAction( idMk, desc418, DialogModes.NO );
    var idsetd = charIDToTypeID( "setd" );
    var desc421 = new ActionDescriptor();
    var idnull = charIDToTypeID( "null" );
    var ref133 = new ActionReference();
    var idAdjL = charIDToTypeID( "AdjL" );
    var idOrdn = charIDToTypeID( "Ordn" );
    var idTrgt = charIDToTypeID( "Trgt" );
    ref133.putEnumerated( idAdjL, idOrdn, idTrgt );
    desc421.putReference( idnull, ref133 );
    var idT = charIDToTypeID( "T   " );
    var desc422 = new ActionDescriptor();
    var idpresetKind = stringIDToTypeID( "presetKind" );
    var idpresetKindType = stringIDToTypeID( "presetKindType" );
    var idpresetKindCustom = stringIDToTypeID( "presetKindCustom" );
    desc422.putEnumerated( idpresetKind, idpresetKindType, idpresetKindCustom );
    var idAdjs = charIDToTypeID( "Adjs" );
    var list95 = new ActionList();
    var desc423 = new ActionDescriptor();
    var idChnl = charIDToTypeID( "Chnl" );
    var ref134 = new ActionReference();
    var idChnl = charIDToTypeID( "Chnl" );
    var idChnl = charIDToTypeID( "Chnl" );
    var idCmps = charIDToTypeID( "Cmps" );
    ref134.putEnumerated( idChnl, idChnl, idCmps );
    desc423.putReference( idChnl, ref134 );
    var idMpng = charIDToTypeID( "Mpng" );
    var list96 = new ActionList();
    for (x=0;x<=255;x++){
        if (x<254){
                        list96.putInteger(0);
                    
                }
                else{
                    list96.putInteger(255);
                
            }
            }

    desc423.putList( idMpng, list96 );
    var idCrvA = charIDToTypeID( "CrvA" );
    list95.putObject( idCrvA, desc423 );
    desc422.putList( idAdjs, list95 );
    var idCrvs = charIDToTypeID( "Crvs" );
    desc421.putObject( idT, idCrvs, desc422 );
    executeAction( idsetd, desc421, DialogModes.NO );
    
    // =======================================================
    
    var idslct = charIDToTypeID( "slct" );
    var desc426 = new ActionDescriptor();
    var idnull = charIDToTypeID( "null" );
    var ref137 = new ActionReference();
    var idChnl = charIDToTypeID( "Chnl" );
    var idChnl = charIDToTypeID( "Chnl" );
    var idCMYK = charIDToTypeID( "CMYK" );
    ref137.putEnumerated( idChnl, idChnl, idCMYK );
    desc426.putReference( idnull, ref137 );
    var idMkVs = charIDToTypeID( "MkVs" );
    desc426.putBoolean( idMkVs, false );
    executeAction( idslct, desc426, DialogModes.NO );
    
    //CLIPPING CURVE
    
    var idGrpL = charIDToTypeID( "GrpL" );
    var desc22 = new ActionDescriptor();
    var idnull = charIDToTypeID( "null" );
    var ref5 = new ActionReference();
    var idLyr = charIDToTypeID( "Lyr " );
    var idOrdn = charIDToTypeID( "Ordn" );
    var idTrgt = charIDToTypeID( "Trgt" );
    ref5.putEnumerated( idLyr, idOrdn, idTrgt );
     desc22.putReference( idnull, ref5 );
    executeAction( idGrpL, desc22, DialogModes.NO );
    
    //MERGE TWO
    
    var idMrgtwo = charIDToTypeID( "Mrg2" );
    var desc64 = new ActionDescriptor();
    executeAction( idMrgtwo, desc64, DialogModes.NO );
    
    // =======================================================
    var idsetd = charIDToTypeID( "setd" );
    var desc427 = new ActionDescriptor();
    var idnull = charIDToTypeID( "null" );
    var ref138 = new ActionReference();
    var idLyr = charIDToTypeID( "Lyr " );
    var idOrdn = charIDToTypeID( "Ordn" );
    var idTrgt = charIDToTypeID( "Trgt" );
    ref138.putEnumerated( idLyr, idOrdn, idTrgt );
    desc427.putReference( idnull, ref138 );
    var idT = charIDToTypeID( "T   " );
    var desc428 = new ActionDescriptor();
    var idNm = charIDToTypeID( "Nm  " );
    desc428.putString( idNm, """TSTMAXCLRS""");
    var idLyr = charIDToTypeID( "Lyr " );
    desc427.putObject( idT, idLyr, desc428 );
    executeAction( idsetd, desc427, DialogModes.NO );
    
    // =======================================================
    var idslct = charIDToTypeID( "slct" );
    var desc1639 = new ActionDescriptor();
    var idnull = charIDToTypeID( "null" );
    var ref779 = new ActionReference();
    var idLyr = charIDToTypeID( "Lyr " );
    ref779.putName( idLyr, "TSTMAXCLRS" );
    desc1639.putReference( idnull, ref779 );
    var idMkVs = charIDToTypeID( "MkVs" );
    desc1639.putBoolean( idMkVs, false );
    var idLyrI = charIDToTypeID( "LyrI" );
    var list248 = new ActionList();
    list248.putInteger( 2571 );
    desc1639.putList( idLyrI, list248 );
    executeAction( idslct, desc1639, DialogModes.NO );
    
    // =======================================================
    var idMk = charIDToTypeID( "Mk  " );
    var desc1596 = new ActionDescriptor();
    var idnull = charIDToTypeID( "null" );
    var ref752 = new ActionReference();
    var idAdjL = charIDToTypeID( "AdjL" );
    ref752.putClass( idAdjL );
    desc1596.putReference( idnull, ref752 );
    var idUsng = charIDToTypeID( "Usng" );
    var desc1597 = new ActionDescriptor();
    var idType = charIDToTypeID( "Type" );
    var desc1598 = new ActionDescriptor();
    var idpresetKind = stringIDToTypeID( "presetKind" );
    var idpresetKindType = stringIDToTypeID( "presetKindType" );
    var idpresetKindDefault = stringIDToTypeID( "presetKindDefault" );
    desc1598.putEnumerated( idpresetKind, idpresetKindType, idpresetKindDefault );
    var idCrvs = charIDToTypeID( "Crvs" );
    desc1597.putObject( idType, idCrvs, desc1598 );
    var idAdjL = charIDToTypeID( "AdjL" );
    desc1596.putObject( idUsng, idAdjL, desc1597 );
    executeAction( idMk, desc1596, DialogModes.NO );
    
    // =======================================================
    var idsetd = charIDToTypeID( "setd" );
    var desc427 = new ActionDescriptor();
    var idnull = charIDToTypeID( "null" );
    var ref138 = new ActionReference();
    var idLyr = charIDToTypeID( "Lyr " );
    var idOrdn = charIDToTypeID( "Ordn" );
    var idTrgt = charIDToTypeID( "Trgt" );
    ref138.putEnumerated( idLyr, idOrdn, idTrgt );
    desc427.putReference( idnull, ref138 );
    var idT = charIDToTypeID( "T   " );
    var desc428 = new ActionDescriptor();
    var idNm = charIDToTypeID( "Nm  " );
    desc428.putString( idNm, """TSTCYN""");
    var idLyr = charIDToTypeID( "Lyr " );
    desc427.putObject( idT, idLyr, desc428 );
    executeAction( idsetd, desc427, DialogModes.NO );
    
    // =======================================================
    var idslct = charIDToTypeID( "slct" );
    var desc1604 = new ActionDescriptor();
    var idnull = charIDToTypeID( "null" );
        var ref755 = new ActionReference();
        var idLyr = charIDToTypeID( "Lyr " );
        ref755.putName( idLyr, "TSTMAXCLRS" );
    desc1604.putReference( idnull, ref755 );
    var idMkVs = charIDToTypeID( "MkVs" );
    desc1604.putBoolean( idMkVs, false );
    var idLyrI = charIDToTypeID( "LyrI" );
        var list237 = new ActionList();
        list237.putInteger( 2571 );
    desc1604.putList( idLyrI, list237 );
    executeAction( idslct, desc1604, DialogModes.NO );
    
    // =======================================================
    var idslct = charIDToTypeID( "slct" );
    var desc1605 = new ActionDescriptor();
    var idnull = charIDToTypeID( "null" );
        var ref756 = new ActionReference();
        var idChnl = charIDToTypeID( "Chnl" );
        var idChnl = charIDToTypeID( "Chnl" );
        var idCyn = charIDToTypeID( "Cyn " );
        ref756.putEnumerated( idChnl, idChnl, idCyn );
    desc1605.putReference( idnull, ref756 );
    executeAction( idslct, desc1605, DialogModes.NO );
    
    // =======================================================
    var idsetd = charIDToTypeID( "setd" );
    var desc1607 = new ActionDescriptor();
    var idnull = charIDToTypeID( "null" );
        var ref757 = new ActionReference();
        var idChnl = charIDToTypeID( "Chnl" );
        var idfsel = charIDToTypeID( "fsel" );
        ref757.putProperty( idChnl, idfsel );
    desc1607.putReference( idnull, ref757 );
    var idT = charIDToTypeID( "T   " );
    var idOrdn = charIDToTypeID( "Ordn" );
    var idAl = charIDToTypeID( "Al  " );
    desc1607.putEnumerated( idT, idOrdn, idAl );
    executeAction( idsetd, desc1607, DialogModes.NO );
    
    // =======================================================
    var idcopy = charIDToTypeID( "copy" );
    executeAction( idcopy, undefined, DialogModes.NO );
    
    // =======================================================
    var idslct = charIDToTypeID( "slct" );
    var desc1609 = new ActionDescriptor();
    var idnull = charIDToTypeID( "null" );
        var ref758 = new ActionReference();
        var idLyr = charIDToTypeID( "Lyr " );
        ref758.putName( idLyr, "TSTCYN" );
    desc1609.putReference( idnull, ref758 );
    var idMkVs = charIDToTypeID( "MkVs" );
    desc1609.putBoolean( idMkVs, false );
    var idLyrI = charIDToTypeID( "LyrI" );
        var list238 = new ActionList();
        list238.putInteger( 2581 );
    desc1609.putList( idLyrI, list238 );
    executeAction( idslct, desc1609, DialogModes.NO );
    
    // =======================================================
    var idShw = charIDToTypeID( "Shw " );
    var desc1610 = new ActionDescriptor();
    var idnull = charIDToTypeID( "null" );
        var list239 = new ActionList();
            var ref759 = new ActionReference();
            var idChnl = charIDToTypeID( "Chnl" );
            var idOrdn = charIDToTypeID( "Ordn" );
            var idTrgt = charIDToTypeID( "Trgt" );
            ref759.putEnumerated( idChnl, idOrdn, idTrgt );
        list239.putReference( ref759 );
    desc1610.putList( idnull, list239 );
    executeAction( idShw, desc1610, DialogModes.NO );
    
    // =======================================================
    var idHd = charIDToTypeID( "Hd  " );
    var desc1611 = new ActionDescriptor();
    var idnull = charIDToTypeID( "null" );
        var list240 = new ActionList();
            var ref760 = new ActionReference();
            var idChnl = charIDToTypeID( "Chnl" );
            var idChnl = charIDToTypeID( "Chnl" );
            var idCyn = charIDToTypeID( "Cyn " );
            ref760.putEnumerated( idChnl, idChnl, idCyn );
        list240.putReference( ref760 );
            var ref761 = new ActionReference();
            var idChnl = charIDToTypeID( "Chnl" );
            var idChnl = charIDToTypeID( "Chnl" );
            var idMgnt = charIDToTypeID( "Mgnt" );
            ref761.putEnumerated( idChnl, idChnl, idMgnt );
        list240.putReference( ref761 );
            var ref762 = new ActionReference();
            var idChnl = charIDToTypeID( "Chnl" );
            var idChnl = charIDToTypeID( "Chnl" );
            var idYllw = charIDToTypeID( "Yllw" );
            ref762.putEnumerated( idChnl, idChnl, idYllw );
        list240.putReference( ref762 );
            var ref763 = new ActionReference();
            var idChnl = charIDToTypeID( "Chnl" );
            var idChnl = charIDToTypeID( "Chnl" );
            var idBlck = charIDToTypeID( "Blck" );
            ref763.putEnumerated( idChnl, idChnl, idBlck );
        list240.putReference( ref763 );
    desc1611.putList( idnull, list240 );
    executeAction( idHd, desc1611, DialogModes.NO );
    
    // =======================================================
    var idpast = charIDToTypeID( "past" );
    var desc1613 = new ActionDescriptor();
    var idinPlace = stringIDToTypeID( "inPlace" );
    desc1613.putBoolean( idinPlace, true );
    var idAntA = charIDToTypeID( "AntA" );
    var idAnnt = charIDToTypeID( "Annt" );
    var idAnno = charIDToTypeID( "Anno" );
    desc1613.putEnumerated( idAntA, idAnnt, idAnno );
    var idAs = charIDToTypeID( "As  " );
    var idPxel = charIDToTypeID( "Pxel" );
    desc1613.putClass( idAs, idPxel );
    executeAction( idpast, desc1613, DialogModes.NO );
    
    // =======================================================
    var idInvr = charIDToTypeID( "Invr" );
    executeAction( idInvr, undefined, DialogModes.NO );
    
    // =======================================================
    var idsetd = charIDToTypeID( "setd" );
    var desc1638 = new ActionDescriptor();
    var idnull = charIDToTypeID( "null" );
        var ref778 = new ActionReference();
        var idChnl = charIDToTypeID( "Chnl" );
        var idfsel = charIDToTypeID( "fsel" );
        ref778.putProperty( idChnl, idfsel );
    desc1638.putReference( idnull, ref778 );
    var idT = charIDToTypeID( "T   " );
    var idOrdn = charIDToTypeID( "Ordn" );
    var idNone = charIDToTypeID( "None" );
    desc1638.putEnumerated( idT, idOrdn, idNone );
    executeAction( idsetd, desc1638, DialogModes.NO );
    
    // =======================================================
    var idsetd = charIDToTypeID( "setd" );
        var desc90 = new ActionDescriptor();
        var idnull = charIDToTypeID( "null" );
            var ref49 = new ActionReference();
            var idChnl = charIDToTypeID( "Chnl" );
            var idfsel = charIDToTypeID( "fsel" );
            ref49.putProperty( idChnl, idfsel );
        desc90.putReference( idnull, ref49 );
        var idT = charIDToTypeID( "T   " );
            var ref50 = new ActionReference();
            var idChnl = charIDToTypeID( "Chnl" );
            var idChnl = charIDToTypeID( "Chnl" );
            var idMsk = charIDToTypeID( "Msk " );
            ref50.putEnumerated( idChnl, idChnl, idMsk );
        desc90.putReference( idT, ref50 );
    executeAction( idsetd, desc90, DialogModes.NO );
    
    var layer = app.activeDocument.activeLayer;
    var layerName = layer.name;
        
    if (!(layer.allLocked || layer.pixelsLocked || layer.positionLocked || layer.transparentPixelsLocked || (0 !== layer.linkedLayers.length))) { 
            if ((0 === layer.bounds[2] && (0 === layer.bounds[3]))) {
                layer.remove();
            }
            else {
    
    
    //CLIPPING CURVE
    
    var idGrpL = charIDToTypeID( "GrpL" );
       var desc22 = new ActionDescriptor();
       var idnull = charIDToTypeID( "null" );
           var ref5 = new ActionReference();
           var idLyr = charIDToTypeID( "Lyr " );
           var idOrdn = charIDToTypeID( "Ordn" );
           var idTrgt = charIDToTypeID( "Trgt" );
           ref5.putEnumerated( idLyr, idOrdn, idTrgt );
       desc22.putReference( idnull, ref5 );
    executeAction( idGrpL, desc22, DialogModes.NO );
         }
    
            }
    
    // =======================================================
    var idslct = charIDToTypeID( "slct" );
    var desc1639 = new ActionDescriptor();
    var idnull = charIDToTypeID( "null" );
        var ref779 = new ActionReference();
        var idLyr = charIDToTypeID( "Lyr " );
        ref779.putName( idLyr, "TSTMAXCLRS" );
    desc1639.putReference( idnull, ref779 );
    var idMkVs = charIDToTypeID( "MkVs" );
    desc1639.putBoolean( idMkVs, false );
    var idLyrI = charIDToTypeID( "LyrI" );
        var list248 = new ActionList();
        list248.putInteger( 2571 );
    desc1639.putList( idLyrI, list248 );
    executeAction( idslct, desc1639, DialogModes.NO );
    
    ///////MAGENTA/////
    var idslct = charIDToTypeID( "slct" );
    var desc1639 = new ActionDescriptor();
    var idnull = charIDToTypeID( "null" );
        var ref779 = new ActionReference();
        var idLyr = charIDToTypeID( "Lyr " );
        ref779.putName( idLyr, "TSTMAXCLRS" );
    desc1639.putReference( idnull, ref779 );
    var idMkVs = charIDToTypeID( "MkVs" );
    desc1639.putBoolean( idMkVs, false );
    var idLyrI = charIDToTypeID( "LyrI" );
        var list248 = new ActionList();
        list248.putInteger( 2571 );
    desc1639.putList( idLyrI, list248 );
    executeAction( idslct, desc1639, DialogModes.NO );
    // =======================================================
    var idsetd = charIDToTypeID( "setd" );
    var desc1617 = new ActionDescriptor();
    var idnull = charIDToTypeID( "null" );
        var ref765 = new ActionReference();
        var idChnl = charIDToTypeID( "Chnl" );
        var idfsel = charIDToTypeID( "fsel" );
        ref765.putProperty( idChnl, idfsel );
    desc1617.putReference( idnull, ref765 );
    var idT = charIDToTypeID( "T   " );
    var idOrdn = charIDToTypeID( "Ordn" );
    var idNone = charIDToTypeID( "None" );
    desc1617.putEnumerated( idT, idOrdn, idNone );
    executeAction( idsetd, desc1617, DialogModes.NO );
    
    // =======================================================
    var idMk = charIDToTypeID( "Mk  " );
    var desc1618 = new ActionDescriptor();
    var idnull = charIDToTypeID( "null" );
        var ref766 = new ActionReference();
        var idAdjL = charIDToTypeID( "AdjL" );
        ref766.putClass( idAdjL );
    desc1618.putReference( idnull, ref766 );
    var idUsng = charIDToTypeID( "Usng" );
        var desc1619 = new ActionDescriptor();
        var idType = charIDToTypeID( "Type" );
            var desc1620 = new ActionDescriptor();
            var idpresetKind = stringIDToTypeID( "presetKind" );
            var idpresetKindType = stringIDToTypeID( "presetKindType" );
            var idpresetKindDefault = stringIDToTypeID( "presetKindDefault" );
            desc1620.putEnumerated( idpresetKind, idpresetKindType, idpresetKindDefault );
        var idCrvs = charIDToTypeID( "Crvs" );
        desc1619.putObject( idType, idCrvs, desc1620 );
    var idAdjL = charIDToTypeID( "AdjL" );
    desc1618.putObject( idUsng, idAdjL, desc1619 );
    executeAction( idMk, desc1618, DialogModes.NO );
    
    // =======================================================
    var idsetd = charIDToTypeID( "setd" );
    var desc427 = new ActionDescriptor();
    var idnull = charIDToTypeID( "null" );
    var ref138 = new ActionReference();
    var idLyr = charIDToTypeID( "Lyr " );
    var idOrdn = charIDToTypeID( "Ordn" );
    var idTrgt = charIDToTypeID( "Trgt" );
    ref138.putEnumerated( idLyr, idOrdn, idTrgt );
    desc427.putReference( idnull, ref138 );
    var idT = charIDToTypeID( "T   " );
    var desc428 = new ActionDescriptor();
    var idNm = charIDToTypeID( "Nm  " );
    desc428.putString( idNm, """TSTMGNT""");
    var idLyr = charIDToTypeID( "Lyr " );
    desc427.putObject( idT, idLyr, desc428 );
    executeAction( idsetd, desc427, DialogModes.NO );
    
    // =======================================================
    var idslct = charIDToTypeID( "slct" );
    var desc1626 = new ActionDescriptor();
    var idnull = charIDToTypeID( "null" );
        var ref769 = new ActionReference();
        var idLyr = charIDToTypeID( "Lyr " );
        ref769.putName( idLyr, "TSTMAXCLRS" );
    desc1626.putReference( idnull, ref769 );
    var idMkVs = charIDToTypeID( "MkVs" );
    desc1626.putBoolean( idMkVs, false );
    var idLyrI = charIDToTypeID( "LyrI" );
        var list244 = new ActionList();
        list244.putInteger( 2571 );
    desc1626.putList( idLyrI, list244 );
    executeAction( idslct, desc1626, DialogModes.NO );
    
    // =======================================================
    var idslct = charIDToTypeID( "slct" );
    var desc1627 = new ActionDescriptor();
    var idnull = charIDToTypeID( "null" );
        var ref770 = new ActionReference();
        var idChnl = charIDToTypeID( "Chnl" );
        var idChnl = charIDToTypeID( "Chnl" );
        var idMgnt = charIDToTypeID( "Mgnt" );
        ref770.putEnumerated( idChnl, idChnl, idMgnt );
    desc1627.putReference( idnull, ref770 );
    executeAction( idslct, desc1627, DialogModes.NO );
    
    // =======================================================
    var idsetd = charIDToTypeID( "setd" );
    var desc1629 = new ActionDescriptor();
    var idnull = charIDToTypeID( "null" );
        var ref771 = new ActionReference();
        var idChnl = charIDToTypeID( "Chnl" );
        var idfsel = charIDToTypeID( "fsel" );
        ref771.putProperty( idChnl, idfsel );
    desc1629.putReference( idnull, ref771 );
    var idT = charIDToTypeID( "T   " );
    var idOrdn = charIDToTypeID( "Ordn" );
    var idAl = charIDToTypeID( "Al  " );
    desc1629.putEnumerated( idT, idOrdn, idAl );
    executeAction( idsetd, desc1629, DialogModes.NO );
    
    // =======================================================
    var idcopy = charIDToTypeID( "copy" );
    executeAction( idcopy, undefined, DialogModes.NO );
    
    // =======================================================
    var idslct = charIDToTypeID( "slct" );
    var desc1631 = new ActionDescriptor();
    var idnull = charIDToTypeID( "null" );
        var ref772 = new ActionReference();
        var idLyr = charIDToTypeID( "Lyr " );
        ref772.putName( idLyr, "TSTMGNT" );
    desc1631.putReference( idnull, ref772 );
    var idMkVs = charIDToTypeID( "MkVs" );
    desc1631.putBoolean( idMkVs, false );
    var idLyrI = charIDToTypeID( "LyrI" );
        var list245 = new ActionList();
        list245.putInteger( 2582 );
    desc1631.putList( idLyrI, list245 );
    executeAction( idslct, desc1631, DialogModes.NO );
    
    // =======================================================
    var idShw = charIDToTypeID( "Shw " );
    var desc1632 = new ActionDescriptor();
    var idnull = charIDToTypeID( "null" );
        var list246 = new ActionList();
            var ref773 = new ActionReference();
            var idChnl = charIDToTypeID( "Chnl" );
            var idOrdn = charIDToTypeID( "Ordn" );
            var idTrgt = charIDToTypeID( "Trgt" );
            ref773.putEnumerated( idChnl, idOrdn, idTrgt );
        list246.putReference( ref773 );
    desc1632.putList( idnull, list246 );
    executeAction( idShw, desc1632, DialogModes.NO );
    
    // =======================================================
    var idHd = charIDToTypeID( "Hd  " );
    var desc1633 = new ActionDescriptor();
    var idnull = charIDToTypeID( "null" );
        var list247 = new ActionList();
            var ref774 = new ActionReference();
            var idChnl = charIDToTypeID( "Chnl" );
            var idChnl = charIDToTypeID( "Chnl" );
            var idCyn = charIDToTypeID( "Cyn " );
            ref774.putEnumerated( idChnl, idChnl, idCyn );
        list247.putReference( ref774 );
            var ref775 = new ActionReference();
            var idChnl = charIDToTypeID( "Chnl" );
            var idChnl = charIDToTypeID( "Chnl" );
            var idMgnt = charIDToTypeID( "Mgnt" );
            ref775.putEnumerated( idChnl, idChnl, idMgnt );
        list247.putReference( ref775 );
            var ref776 = new ActionReference();
            var idChnl = charIDToTypeID( "Chnl" );
            var idChnl = charIDToTypeID( "Chnl" );
            var idYllw = charIDToTypeID( "Yllw" );
            ref776.putEnumerated( idChnl, idChnl, idYllw );
        list247.putReference( ref776 );
            var ref777 = new ActionReference();
            var idChnl = charIDToTypeID( "Chnl" );
            var idChnl = charIDToTypeID( "Chnl" );
            var idBlck = charIDToTypeID( "Blck" );
            ref777.putEnumerated( idChnl, idChnl, idBlck );
        list247.putReference( ref777 );
    desc1633.putList( idnull, list247 );
    executeAction( idHd, desc1633, DialogModes.NO );
    
    // =======================================================
    var idpast = charIDToTypeID( "past" );
    var desc1635 = new ActionDescriptor();
    var idinPlace = stringIDToTypeID( "inPlace" );
    desc1635.putBoolean( idinPlace, true );
    var idAntA = charIDToTypeID( "AntA" );
    var idAnnt = charIDToTypeID( "Annt" );
    var idAnno = charIDToTypeID( "Anno" );
    desc1635.putEnumerated( idAntA, idAnnt, idAnno );
    var idAs = charIDToTypeID( "As  " );
    var idPxel = charIDToTypeID( "Pxel" );
    desc1635.putClass( idAs, idPxel );
    executeAction( idpast, desc1635, DialogModes.NO );
    
    // =======================================================
    var idInvr = charIDToTypeID( "Invr" );
    executeAction( idInvr, undefined, DialogModes.NO );
    
    // =======================================================
    var idsetd = charIDToTypeID( "setd" );
    var desc1638 = new ActionDescriptor();
    var idnull = charIDToTypeID( "null" );
        var ref778 = new ActionReference();
        var idChnl = charIDToTypeID( "Chnl" );
        var idfsel = charIDToTypeID( "fsel" );
        ref778.putProperty( idChnl, idfsel );
    desc1638.putReference( idnull, ref778 );
    var idT = charIDToTypeID( "T   " );
    var idOrdn = charIDToTypeID( "Ordn" );
    var idNone = charIDToTypeID( "None" );
    desc1638.putEnumerated( idT, idOrdn, idNone );
    executeAction( idsetd, desc1638, DialogModes.NO );
    var layer = app.activeDocument.activeLayer;
    var layerName = layer.name;
    
    if (!(layer.allLocked || layer.pixelsLocked || layer.positionLocked || layer.transparentPixelsLocked || (0 !== layer.linkedLayers.length))) { 
        if ((0 === layer.bounds[2] && (0 === layer.bounds[3]))) {
            layer.remove();
        }
        else {
    
    
    try{
    //CLIPPING CURVE
    
    var idGrpL = charIDToTypeID( "GrpL" );
       var desc22 = new ActionDescriptor();
       var idnull = charIDToTypeID( "null" );
           var ref5 = new ActionReference();
           var idLyr = charIDToTypeID( "Lyr " );
           var idOrdn = charIDToTypeID( "Ordn" );
           var idTrgt = charIDToTypeID( "Trgt" );
           ref5.putEnumerated( idLyr, idOrdn, idTrgt );
       desc22.putReference( idnull, ref5 );
    executeAction( idGrpL, desc22, DialogModes.NO );
    
     }
    catch(e){}
        }
    }
        ///// select layer
        var idslct = charIDToTypeID( "slct" );
        var desc1639 = new ActionDescriptor();
        var idnull = charIDToTypeID( "null" );
            var ref779 = new ActionReference();
            var idLyr = charIDToTypeID( "Lyr " );
            ref779.putName( idLyr, "TSTMAXCLRS" );
        desc1639.putReference( idnull, ref779 );
        var idMkVs = charIDToTypeID( "MkVs" );
        desc1639.putBoolean( idMkVs, false );
        var idLyrI = charIDToTypeID( "LyrI" );
            var list248 = new ActionList();
            list248.putInteger( 2571 );
        desc1639.putList( idLyrI, list248 );
        executeAction( idslct, desc1639, DialogModes.NO );
    
    ////////YELLOW/////
    var idslct = charIDToTypeID( "slct" );
    var desc1639 = new ActionDescriptor();
    var idnull = charIDToTypeID( "null" );
        var ref779 = new ActionReference();
        var idLyr = charIDToTypeID( "Lyr " );
        ref779.putName( idLyr, "TSTMAXCLRS" );
    desc1639.putReference( idnull, ref779 );
    var idMkVs = charIDToTypeID( "MkVs" );
    desc1639.putBoolean( idMkVs, false );
    var idLyrI = charIDToTypeID( "LyrI" );
        var list248 = new ActionList();
        list248.putInteger( 2571 );
    desc1639.putList( idLyrI, list248 );
    executeAction( idslct, desc1639, DialogModes.NO );
    // =======================================================
    var idsetd = charIDToTypeID( "setd" );
    var desc1617 = new ActionDescriptor();
    var idnull = charIDToTypeID( "null" );
        var ref765 = new ActionReference();
        var idChnl = charIDToTypeID( "Chnl" );
        var idfsel = charIDToTypeID( "fsel" );
        ref765.putProperty( idChnl, idfsel );
    desc1617.putReference( idnull, ref765 );
    var idT = charIDToTypeID( "T   " );
    var idOrdn = charIDToTypeID( "Ordn" );
    var idNone = charIDToTypeID( "None" );
    desc1617.putEnumerated( idT, idOrdn, idNone );
    executeAction( idsetd, desc1617, DialogModes.NO );
    
    // =======================================================
    var idMk = charIDToTypeID( "Mk  " );
    var desc1618 = new ActionDescriptor();
    var idnull = charIDToTypeID( "null" );
        var ref766 = new ActionReference();
        var idAdjL = charIDToTypeID( "AdjL" );
        ref766.putClass( idAdjL );
    desc1618.putReference( idnull, ref766 );
    var idUsng = charIDToTypeID( "Usng" );
        var desc1619 = new ActionDescriptor();
        var idType = charIDToTypeID( "Type" );
            var desc1620 = new ActionDescriptor();
            var idpresetKind = stringIDToTypeID( "presetKind" );
            var idpresetKindType = stringIDToTypeID( "presetKindType" );
            var idpresetKindDefault = stringIDToTypeID( "presetKindDefault" );
            desc1620.putEnumerated( idpresetKind, idpresetKindType, idpresetKindDefault );
        var idCrvs = charIDToTypeID( "Crvs" );
        desc1619.putObject( idType, idCrvs, desc1620 );
    var idAdjL = charIDToTypeID( "AdjL" );
    desc1618.putObject( idUsng, idAdjL, desc1619 );
    executeAction( idMk, desc1618, DialogModes.NO );

    // =======================================================
    var idsetd = charIDToTypeID( "setd" );
    var desc427 = new ActionDescriptor();
    var idnull = charIDToTypeID( "null" );
    var ref138 = new ActionReference();
    var idLyr = charIDToTypeID( "Lyr " );
    var idOrdn = charIDToTypeID( "Ordn" );
    var idTrgt = charIDToTypeID( "Trgt" );
    ref138.putEnumerated( idLyr, idOrdn, idTrgt );
    desc427.putReference( idnull, ref138 );
    var idT = charIDToTypeID( "T   " );
    var desc428 = new ActionDescriptor();
    var idNm = charIDToTypeID( "Nm  " );
    desc428.putString( idNm, """TSTYLLW""");
    var idLyr = charIDToTypeID( "Lyr " );
    desc427.putObject( idT, idLyr, desc428 );
    executeAction( idsetd, desc427, DialogModes.NO );
    
    // =======================================================
    var idslct = charIDToTypeID( "slct" );
    var desc1626 = new ActionDescriptor();
    var idnull = charIDToTypeID( "null" );
        var ref769 = new ActionReference();
        var idLyr = charIDToTypeID( "Lyr " );
        ref769.putName( idLyr, "TSTMAXCLRS" );
    desc1626.putReference( idnull, ref769 );
    var idMkVs = charIDToTypeID( "MkVs" );
    desc1626.putBoolean( idMkVs, false );
    var idLyrI = charIDToTypeID( "LyrI" );
        var list244 = new ActionList();
        list244.putInteger( 2571 );
    desc1626.putList( idLyrI, list244 );
    executeAction( idslct, desc1626, DialogModes.NO );
    
    // =======================================================
    var idslct = charIDToTypeID( "slct" );
    var desc1627 = new ActionDescriptor();
    var idnull = charIDToTypeID( "null" );
        var ref770 = new ActionReference();
        var idChnl = charIDToTypeID( "Chnl" );
        var idChnl = charIDToTypeID( "Chnl" );
        var idMgnt = charIDToTypeID( "Yllw" );
        ref770.putEnumerated( idChnl, idChnl, idMgnt );
    desc1627.putReference( idnull, ref770 );
    executeAction( idslct, desc1627, DialogModes.NO );
    
    // =======================================================
    var idsetd = charIDToTypeID( "setd" );
    var desc1629 = new ActionDescriptor();
    var idnull = charIDToTypeID( "null" );
        var ref771 = new ActionReference();
        var idChnl = charIDToTypeID( "Chnl" );
        var idfsel = charIDToTypeID( "fsel" );
        ref771.putProperty( idChnl, idfsel );
    desc1629.putReference( idnull, ref771 );
    var idT = charIDToTypeID( "T   " );
    var idOrdn = charIDToTypeID( "Ordn" );
    var idAl = charIDToTypeID( "Al  " );
    desc1629.putEnumerated( idT, idOrdn, idAl );
    executeAction( idsetd, desc1629, DialogModes.NO );
    
    // =======================================================
    var idcopy = charIDToTypeID( "copy" );
    executeAction( idcopy, undefined, DialogModes.NO );
    
    // =======================================================
    var idslct = charIDToTypeID( "slct" );
    var desc1631 = new ActionDescriptor();
    var idnull = charIDToTypeID( "null" );
        var ref772 = new ActionReference();
        var idLyr = charIDToTypeID( "Lyr " );
        ref772.putName( idLyr, "TSTYLLW" );
    desc1631.putReference( idnull, ref772 );
    var idMkVs = charIDToTypeID( "MkVs" );
    desc1631.putBoolean( idMkVs, false );
    var idLyrI = charIDToTypeID( "LyrI" );
        var list245 = new ActionList();
        list245.putInteger( 2582 );
    desc1631.putList( idLyrI, list245 );
    executeAction( idslct, desc1631, DialogModes.NO );
    
    // =======================================================
    var idShw = charIDToTypeID( "Shw " );
    var desc1632 = new ActionDescriptor();
    var idnull = charIDToTypeID( "null" );
        var list246 = new ActionList();
            var ref773 = new ActionReference();
            var idChnl = charIDToTypeID( "Chnl" );
            var idOrdn = charIDToTypeID( "Ordn" );
            var idTrgt = charIDToTypeID( "Trgt" );
            ref773.putEnumerated( idChnl, idOrdn, idTrgt );
        list246.putReference( ref773 );
    desc1632.putList( idnull, list246 );
    executeAction( idShw, desc1632, DialogModes.NO );
    
    // =======================================================
    var idHd = charIDToTypeID( "Hd  " );
    var desc1633 = new ActionDescriptor();
    var idnull = charIDToTypeID( "null" );
        var list247 = new ActionList();
            var ref774 = new ActionReference();
            var idChnl = charIDToTypeID( "Chnl" );
            var idChnl = charIDToTypeID( "Chnl" );
            var idCyn = charIDToTypeID( "Cyn " );
            ref774.putEnumerated( idChnl, idChnl, idCyn );
        list247.putReference( ref774 );
            var ref775 = new ActionReference();
            var idChnl = charIDToTypeID( "Chnl" );
            var idChnl = charIDToTypeID( "Chnl" );
            var idMgnt = charIDToTypeID( "Mgnt" );
            ref775.putEnumerated( idChnl, idChnl, idMgnt );
        list247.putReference( ref775 );
            var ref776 = new ActionReference();
            var idChnl = charIDToTypeID( "Chnl" );
            var idChnl = charIDToTypeID( "Chnl" );
            var idYllw = charIDToTypeID( "Yllw" );
            ref776.putEnumerated( idChnl, idChnl, idYllw );
        list247.putReference( ref776 );
            var ref777 = new ActionReference();
            var idChnl = charIDToTypeID( "Chnl" );
            var idChnl = charIDToTypeID( "Chnl" );
            var idBlck = charIDToTypeID( "Blck" );
            ref777.putEnumerated( idChnl, idChnl, idBlck );
        list247.putReference( ref777 );
    desc1633.putList( idnull, list247 );
    executeAction( idHd, desc1633, DialogModes.NO );
    
    // =======================================================
    var idpast = charIDToTypeID( "past" );
    var desc1635 = new ActionDescriptor();
    var idinPlace = stringIDToTypeID( "inPlace" );
    desc1635.putBoolean( idinPlace, true );
    var idAntA = charIDToTypeID( "AntA" );
    var idAnnt = charIDToTypeID( "Annt" );
    var idAnno = charIDToTypeID( "Anno" );
    desc1635.putEnumerated( idAntA, idAnnt, idAnno );
    var idAs = charIDToTypeID( "As  " );
    var idPxel = charIDToTypeID( "Pxel" );
    desc1635.putClass( idAs, idPxel );
    executeAction( idpast, desc1635, DialogModes.NO );
    
    // =======================================================
    var idInvr = charIDToTypeID( "Invr" );
    executeAction( idInvr, undefined, DialogModes.NO );
    
    // =======================================================
    var idsetd = charIDToTypeID( "setd" );
    var desc1638 = new ActionDescriptor();
    var idnull = charIDToTypeID( "null" );
        var ref778 = new ActionReference();
        var idChnl = charIDToTypeID( "Chnl" );
        var idfsel = charIDToTypeID( "fsel" );
        ref778.putProperty( idChnl, idfsel );
    desc1638.putReference( idnull, ref778 );
    var idT = charIDToTypeID( "T   " );
    var idOrdn = charIDToTypeID( "Ordn" );
    var idNone = charIDToTypeID( "None" );
    desc1638.putEnumerated( idT, idOrdn, idNone );
    executeAction( idsetd, desc1638, DialogModes.NO );
    
    var layer = app.activeDocument.activeLayer;
    var layerName = layer.name;
    
    if (!(layer.allLocked || layer.pixelsLocked || layer.positionLocked || layer.transparentPixelsLocked || (0 !== layer.linkedLayers.length))) { 
        if ((0 === layer.bounds[2] && (0 === layer.bounds[3]))) {
            layer.remove();
        }
        else {
    
    
    
    try{
    //CLIPPING CURVE
    
    var idGrpL = charIDToTypeID( "GrpL" );
       var desc22 = new ActionDescriptor();
       var idnull = charIDToTypeID( "null" );
           var ref5 = new ActionReference();
           var idLyr = charIDToTypeID( "Lyr " );
           var idOrdn = charIDToTypeID( "Ordn" );
           var idTrgt = charIDToTypeID( "Trgt" );
           ref5.putEnumerated( idLyr, idOrdn, idTrgt );
       desc22.putReference( idnull, ref5 );
    executeAction( idGrpL, desc22, DialogModes.NO );
    }
    catch(e){}
     }
    
        }
    
    ///// select layer
        var idslct = charIDToTypeID( "slct" );
        var desc1639 = new ActionDescriptor();
        var idnull = charIDToTypeID( "null" );
            var ref779 = new ActionReference();
            var idLyr = charIDToTypeID( "Lyr " );
            ref779.putName( idLyr, "TSTMAXCLRS" );
        desc1639.putReference( idnull, ref779 );
        var idMkVs = charIDToTypeID( "MkVs" );
        desc1639.putBoolean( idMkVs, false );
        var idLyrI = charIDToTypeID( "LyrI" );
            var list248 = new ActionList();
            list248.putInteger( 2571 );
        desc1639.putList( idLyrI, list248 );
        executeAction( idslct, desc1639, DialogModes.NO );
    
    ////////BLACK/////
    var idslct = charIDToTypeID( "slct" );
    var desc1639 = new ActionDescriptor();
    var idnull = charIDToTypeID( "null" );
        var ref779 = new ActionReference();
        var idLyr = charIDToTypeID( "Lyr " );
        ref779.putName( idLyr, "TSTMAXCLRS" );
    desc1639.putReference( idnull, ref779 );
    var idMkVs = charIDToTypeID( "MkVs" );
    desc1639.putBoolean( idMkVs, false );
    var idLyrI = charIDToTypeID( "LyrI" );
        var list248 = new ActionList();
        list248.putInteger( 2571 );
    desc1639.putList( idLyrI, list248 );
    executeAction( idslct, desc1639, DialogModes.NO );
    // =======================================================
    var idsetd = charIDToTypeID( "setd" );
    var desc1617 = new ActionDescriptor();
    var idnull = charIDToTypeID( "null" );
        var ref765 = new ActionReference();
        var idChnl = charIDToTypeID( "Chnl" );
        var idfsel = charIDToTypeID( "fsel" );
        ref765.putProperty( idChnl, idfsel );
    desc1617.putReference( idnull, ref765 );
    var idT = charIDToTypeID( "T   " );
    var idOrdn = charIDToTypeID( "Ordn" );
    var idNone = charIDToTypeID( "None" );
    desc1617.putEnumerated( idT, idOrdn, idNone );
    executeAction( idsetd, desc1617, DialogModes.NO );
    
    // =======================================================
    var idMk = charIDToTypeID( "Mk  " );
    var desc1618 = new ActionDescriptor();
    var idnull = charIDToTypeID( "null" );
        var ref766 = new ActionReference();
        var idAdjL = charIDToTypeID( "AdjL" );
        ref766.putClass( idAdjL );
    desc1618.putReference( idnull, ref766 );
    var idUsng = charIDToTypeID( "Usng" );
        var desc1619 = new ActionDescriptor();
        var idType = charIDToTypeID( "Type" );
            var desc1620 = new ActionDescriptor();
            var idpresetKind = stringIDToTypeID( "presetKind" );
            var idpresetKindType = stringIDToTypeID( "presetKindType" );
            var idpresetKindDefault = stringIDToTypeID( "presetKindDefault" );
            desc1620.putEnumerated( idpresetKind, idpresetKindType, idpresetKindDefault );
        var idCrvs = charIDToTypeID( "Crvs" );
        desc1619.putObject( idType, idCrvs, desc1620 );
    var idAdjL = charIDToTypeID( "AdjL" );
    desc1618.putObject( idUsng, idAdjL, desc1619 );
    executeAction( idMk, desc1618, DialogModes.NO );
    
    // =======================================================
    var idsetd = charIDToTypeID( "setd" );
    var desc427 = new ActionDescriptor();
    var idnull = charIDToTypeID( "null" );
    var ref138 = new ActionReference();
    var idLyr = charIDToTypeID( "Lyr " );
    var idOrdn = charIDToTypeID( "Ordn" );
    var idTrgt = charIDToTypeID( "Trgt" );
    ref138.putEnumerated( idLyr, idOrdn, idTrgt );
    desc427.putReference( idnull, ref138 );
    var idT = charIDToTypeID( "T   " );
    var desc428 = new ActionDescriptor();
    var idNm = charIDToTypeID( "Nm  " );
    desc428.putString( idNm, """TSTBLCK""");
    var idLyr = charIDToTypeID( "Lyr " );
    desc427.putObject( idT, idLyr, desc428 );
    executeAction( idsetd, desc427, DialogModes.NO );
    // =======================================================
    var idslct = charIDToTypeID( "slct" );
    var desc1626 = new ActionDescriptor();
    var idnull = charIDToTypeID( "null" );
        var ref769 = new ActionReference();
        var idLyr = charIDToTypeID( "Lyr " );
        ref769.putName( idLyr, "TSTMAXCLRS" );
    desc1626.putReference( idnull, ref769 );
    var idMkVs = charIDToTypeID( "MkVs" );
    desc1626.putBoolean( idMkVs, false );
    var idLyrI = charIDToTypeID( "LyrI" );
        var list244 = new ActionList();
        list244.putInteger( 2571 );
    desc1626.putList( idLyrI, list244 );
    executeAction( idslct, desc1626, DialogModes.NO );
    
        // =======================================================
        var idslct = charIDToTypeID( "slct" );
        var desc1627 = new ActionDescriptor();
        var idnull = charIDToTypeID( "null" );
            var ref770 = new ActionReference();
            var idChnl = charIDToTypeID( "Chnl" );
            var idChnl = charIDToTypeID( "Chnl" );
            var idMgnt = charIDToTypeID( "Blck" );
            ref770.putEnumerated( idChnl, idChnl, idMgnt );
        desc1627.putReference( idnull, ref770 );
        executeAction( idslct, desc1627, DialogModes.NO );
    
    // =======================================================
    var idsetd = charIDToTypeID( "setd" );
    var desc1629 = new ActionDescriptor();
    var idnull = charIDToTypeID( "null" );
        var ref771 = new ActionReference();
        var idChnl = charIDToTypeID( "Chnl" );
        var idfsel = charIDToTypeID( "fsel" );
        ref771.putProperty( idChnl, idfsel );
    desc1629.putReference( idnull, ref771 );
    var idT = charIDToTypeID( "T   " );
    var idOrdn = charIDToTypeID( "Ordn" );
    var idAl = charIDToTypeID( "Al  " );
    desc1629.putEnumerated( idT, idOrdn, idAl );
    executeAction( idsetd, desc1629, DialogModes.NO );
    
    // =======================================================
    var idcopy = charIDToTypeID( "copy" );
    executeAction( idcopy, undefined, DialogModes.NO );
    
    // =======================================================
    var idslct = charIDToTypeID( "slct" );
    var desc1631 = new ActionDescriptor();
    var idnull = charIDToTypeID( "null" );
        var ref772 = new ActionReference();
        var idLyr = charIDToTypeID( "Lyr " );
        ref772.putName( idLyr, "TSTBLCK" );
    desc1631.putReference( idnull, ref772 );
    var idMkVs = charIDToTypeID( "MkVs" );
    desc1631.putBoolean( idMkVs, false );
    var idLyrI = charIDToTypeID( "LyrI" );
        var list245 = new ActionList();
        list245.putInteger( 2582 );
    desc1631.putList( idLyrI, list245 );
    executeAction( idslct, desc1631, DialogModes.NO );
    
    // =======================================================
    var idShw = charIDToTypeID( "Shw " );
    var desc1632 = new ActionDescriptor();
    var idnull = charIDToTypeID( "null" );
        var list246 = new ActionList();
            var ref773 = new ActionReference();
            var idChnl = charIDToTypeID( "Chnl" );
            var idOrdn = charIDToTypeID( "Ordn" );
            var idTrgt = charIDToTypeID( "Trgt" );
            ref773.putEnumerated( idChnl, idOrdn, idTrgt );
        list246.putReference( ref773 );
    desc1632.putList( idnull, list246 );
    executeAction( idShw, desc1632, DialogModes.NO );
    
    // =======================================================
    var idHd = charIDToTypeID( "Hd  " );
    var desc1633 = new ActionDescriptor();
    var idnull = charIDToTypeID( "null" );
        var list247 = new ActionList();
            var ref774 = new ActionReference();
            var idChnl = charIDToTypeID( "Chnl" );
            var idChnl = charIDToTypeID( "Chnl" );
            var idCyn = charIDToTypeID( "Cyn " );
            ref774.putEnumerated( idChnl, idChnl, idCyn );
        list247.putReference( ref774 );
            var ref775 = new ActionReference();
            var idChnl = charIDToTypeID( "Chnl" );
            var idChnl = charIDToTypeID( "Chnl" );
            var idMgnt = charIDToTypeID( "Mgnt" );
            ref775.putEnumerated( idChnl, idChnl, idMgnt );
        list247.putReference( ref775 );
            var ref776 = new ActionReference();
            var idChnl = charIDToTypeID( "Chnl" );
            var idChnl = charIDToTypeID( "Chnl" );
            var idYllw = charIDToTypeID( "Yllw" );
            ref776.putEnumerated( idChnl, idChnl, idYllw );
        list247.putReference( ref776 );
            var ref777 = new ActionReference();
            var idChnl = charIDToTypeID( "Chnl" );
            var idChnl = charIDToTypeID( "Chnl" );
            var idBlck = charIDToTypeID( "Blck" );
            ref777.putEnumerated( idChnl, idChnl, idBlck );
        list247.putReference( ref777 );
    desc1633.putList( idnull, list247 );
    executeAction( idHd, desc1633, DialogModes.NO );
    
    // =======================================================
    var idpast = charIDToTypeID( "past" );
    var desc1635 = new ActionDescriptor();
    var idinPlace = stringIDToTypeID( "inPlace" );
    desc1635.putBoolean( idinPlace, true );
    var idAntA = charIDToTypeID( "AntA" );
    var idAnnt = charIDToTypeID( "Annt" );
    var idAnno = charIDToTypeID( "Anno" );
    desc1635.putEnumerated( idAntA, idAnnt, idAnno );
    var idAs = charIDToTypeID( "As  " );
    var idPxel = charIDToTypeID( "Pxel" );
    desc1635.putClass( idAs, idPxel );
    executeAction( idpast, desc1635, DialogModes.NO );
    
    // =======================================================
    var idInvr = charIDToTypeID( "Invr" );
    executeAction( idInvr, undefined, DialogModes.NO );
    
    // =======================================================
    var idsetd = charIDToTypeID( "setd" );
    var desc1638 = new ActionDescriptor();
    var idnull = charIDToTypeID( "null" );
        var ref778 = new ActionReference();
        var idChnl = charIDToTypeID( "Chnl" );
        var idfsel = charIDToTypeID( "fsel" );
        ref778.putProperty( idChnl, idfsel );
    desc1638.putReference( idnull, ref778 );
    var idT = charIDToTypeID( "T   " );
    var idOrdn = charIDToTypeID( "Ordn" );
    var idNone = charIDToTypeID( "None" );
    desc1638.putEnumerated( idT, idOrdn, idNone );
    executeAction( idsetd, desc1638, DialogModes.NO );
    
    var layer = app.activeDocument.activeLayer;
    var layerName = layer.name;
    if (!(layer.allLocked || layer.pixelsLocked || layer.positionLocked || layer.transparentPixelsLocked || (0 !== layer.linkedLayers.length))) { 
        if ((0 === layer.bounds[2] && (0 === layer.bounds[3]))) {
            layer.remove();
        }
        else {
    
    try{
        //CLIPPING CURVE
        
        var idGrpL = charIDToTypeID( "GrpL" );
           var desc22 = new ActionDescriptor();
           var idnull = charIDToTypeID( "null" );
               var ref5 = new ActionReference();
               var idLyr = charIDToTypeID( "Lyr " );
               var idOrdn = charIDToTypeID( "Ordn" );
               var idTrgt = charIDToTypeID( "Trgt" );
               ref5.putEnumerated( idLyr, idOrdn, idTrgt );
           desc22.putReference( idnull, ref5 );
        executeAction( idGrpL, desc22, DialogModes.NO );
        }
        catch(e){}
     }
    
        }
        // =======================================================
    var idsetd = charIDToTypeID( "setd" );
    var desc38 = new ActionDescriptor();
    var idnull = charIDToTypeID( "null" );
        var ref10 = new ActionReference();
        var idChnl = charIDToTypeID( "Chnl" );
        var idfsel = charIDToTypeID( "fsel" );
        ref10.putProperty( idChnl, idfsel );
    desc38.putReference( idnull, ref10 );
    var idT = charIDToTypeID( "T   " );
        var ref11 = new ActionReference();
        var idChnl = charIDToTypeID( "Chnl" );
        var idChnl = charIDToTypeID( "Chnl" );
        var idMsk = charIDToTypeID( "Msk " );
        ref11.putEnumerated( idChnl, idChnl, idMsk );
    desc38.putReference( idT, ref11 );
    executeAction( idsetd, desc38, DialogModes.NO );
        try{
    //////////// Maska na layeru
    // =======================================================
    var idAdd = charIDToTypeID( "Add " );
        var desc39 = new ActionDescriptor();
        var idnull = charIDToTypeID( "null" );
            var ref12 = new ActionReference();
            var idChnl = charIDToTypeID( "Chnl" );
            var idChnl = charIDToTypeID( "Chnl" );
            var idMsk = charIDToTypeID( "Msk " );
            ref12.putEnumerated( idChnl, idChnl, idMsk );
            var idLyr = charIDToTypeID( "Lyr " );
            ref12.putName( idLyr, "TSTCYN" );
        desc39.putReference( idnull, ref12 );
        var idT = charIDToTypeID( "T   " );
            var ref13 = new ActionReference();
            var idChnl = charIDToTypeID( "Chnl" );
            var idfsel = charIDToTypeID( "fsel" );
            ref13.putProperty( idChnl, idfsel );
        desc39.putReference( idT, ref13 );
    executeAction( idAdd, desc39, DialogModes.NO );
    
                }
                catch(e){
                }
                try{
                    //////////// Maska na layeru
    // =======================================================
    var idAdd = charIDToTypeID( "Add " );
        var desc39 = new ActionDescriptor();
        var idnull = charIDToTypeID( "null" );
            var ref12 = new ActionReference();
            var idChnl = charIDToTypeID( "Chnl" );
            var idChnl = charIDToTypeID( "Chnl" );
            var idMsk = charIDToTypeID( "Msk " );
            ref12.putEnumerated( idChnl, idChnl, idMsk );
            var idLyr = charIDToTypeID( "Lyr " );
            ref12.putName( idLyr, "TSTMGNT" );
        desc39.putReference( idnull, ref12 );
        var idT = charIDToTypeID( "T   " );
            var ref13 = new ActionReference();
            var idChnl = charIDToTypeID( "Chnl" );
            var idfsel = charIDToTypeID( "fsel" );
            ref13.putProperty( idChnl, idfsel );
        desc39.putReference( idT, ref13 );
    executeAction( idAdd, desc39, DialogModes.NO );
                                }
                                catch(e){
                                }
    
                                try{
                                    //////////// Maska na layeru
    // =======================================================
    var idAdd = charIDToTypeID( "Add " );
        var desc40 = new ActionDescriptor();
        var idnull = charIDToTypeID( "null" );
            var ref14 = new ActionReference();
            var idChnl = charIDToTypeID( "Chnl" );
            var idChnl = charIDToTypeID( "Chnl" );
            var idMsk = charIDToTypeID( "Msk " );
            ref14.putEnumerated( idChnl, idChnl, idMsk );
            var idLyr = charIDToTypeID( "Lyr " );
            ref14.putName( idLyr, "TSTYLLW" );
        desc40.putReference( idnull, ref14 );
        var idT = charIDToTypeID( "T   " );
            var ref15 = new ActionReference();
            var idChnl = charIDToTypeID( "Chnl" );
            var idfsel = charIDToTypeID( "fsel" );
            ref15.putProperty( idChnl, idfsel );
        desc40.putReference( idT, ref15 );
    executeAction( idAdd, desc40, DialogModes.NO );
                                                }
                                                catch(e){
                                                }
                                                try{
                                                    //////////// Maska na layeru
    // =======================================================
    var idAdd = charIDToTypeID( "Add " );
        var desc41 = new ActionDescriptor();
        var idnull = charIDToTypeID( "null" );
            var ref16 = new ActionReference();
            var idChnl = charIDToTypeID( "Chnl" );
            var idChnl = charIDToTypeID( "Chnl" );
            var idMsk = charIDToTypeID( "Msk " );
            ref16.putEnumerated( idChnl, idChnl, idMsk );
            var idLyr = charIDToTypeID( "Lyr " );
            ref16.putName( idLyr, "TSTBLCK" );
        desc41.putReference( idnull, ref16 );
        var idT = charIDToTypeID( "T   " );
            var ref17 = new ActionReference();
            var idChnl = charIDToTypeID( "Chnl" );
            var idfsel = charIDToTypeID( "fsel" );
            ref17.putProperty( idChnl, idfsel );
        desc41.putReference( idT, ref17 );
    executeAction( idAdd, desc41, DialogModes.NO );
                                                                }
                                                                catch(e){
                                                                }
    
    // =======================================================
    ///// select layer
    var idslct = charIDToTypeID( "slct" );
    var desc1639 = new ActionDescriptor();
    var idnull = charIDToTypeID( "null" );
        var ref779 = new ActionReference();
        var idLyr = charIDToTypeID( "Lyr " );
        ref779.putName( idLyr, "TSTMAXCLRS" );
    desc1639.putReference( idnull, ref779 );
    var idMkVs = charIDToTypeID( "MkVs" );
    desc1639.putBoolean( idMkVs, false );
    var idLyrI = charIDToTypeID( "LyrI" );
        var list248 = new ActionList();
        list248.putInteger( 2571 );
    desc1639.putList( idLyrI, list248 );
    executeAction( idslct, desc1639, DialogModes.NO );
    
    ///////////// SLECT LAYER BELLOW//////
    var doc = app.activeDocument;
    var ix = doc.activeLayer.itemIndex;
    for(var i = 0; i < doc.layers.length; i++) {
    
      if(doc.layers[i].itemIndex === ix - 1) {
       app.activeDocument.activeLayer = doc.layers[i];
    
      }
    
    }
    // =======================================================
    var idMk = charIDToTypeID( "Mk  " );
        var desc12370 = new ActionDescriptor();
        var idNw = charIDToTypeID( "Nw  " );
        var idChnl = charIDToTypeID( "Chnl" );
        desc12370.putClass( idNw, idChnl );
        var idAt = charIDToTypeID( "At  " );
            var ref3497 = new ActionReference();
            var idChnl = charIDToTypeID( "Chnl" );
            var idChnl = charIDToTypeID( "Chnl" );
            var idMsk = charIDToTypeID( "Msk " );
            ref3497.putEnumerated( idChnl, idChnl, idMsk );
        desc12370.putReference( idAt, ref3497 );
        var idUsng = charIDToTypeID( "Usng" );
        var idUsrM = charIDToTypeID( "UsrM" );
        var idRvlS = charIDToTypeID( "RvlS" );
        desc12370.putEnumerated( idUsng, idUsrM, idRvlS );
    executeAction( idMk, desc12370, DialogModes.NO );
    
    // =======================================================
    var idsetd = charIDToTypeID( "setd" );
        var desc2535 = new ActionDescriptor();
        var idnull = charIDToTypeID( "null" );
            var ref1106 = new ActionReference();
            var idLyr = charIDToTypeID( "Lyr " );
            var idOrdn = charIDToTypeID( "Ordn" );
            var idTrgt = charIDToTypeID( "Trgt" );
            ref1106.putEnumerated( idLyr, idOrdn, idTrgt );
        desc2535.putReference( idnull, ref1106 );
        var idT = charIDToTypeID( "T   " );
            var desc2536 = new ActionDescriptor();
            var idUsrM = charIDToTypeID( "UsrM" );
            desc2536.putBoolean( idUsrM, false );
        var idLyr = charIDToTypeID( "Lyr " );
        desc2535.putObject( idT, idLyr, desc2536 );
    executeAction( idsetd, desc2535, DialogModes.NO );
    
    
    // =======================================================
    var idHd = charIDToTypeID( "Hd  " );
        var desc13115 = new ActionDescriptor();
        var idnull = charIDToTypeID( "null" );
            var list2476 = new ActionList();
                var ref3626 = new ActionReference();
                var idChnl = charIDToTypeID( "Chnl" );
                var idChnl = charIDToTypeID( "Chnl" );
                var idMsk = charIDToTypeID( "Msk " );
                ref3626.putEnumerated( idChnl, idChnl, idMsk );
            list2476.putReference( ref3626 );
        desc13115.putList( idnull, list2476 );
    executeAction( idHd, desc13115, DialogModes.NO );
        try{
            // =======================================================
            var idslct = charIDToTypeID( "slct" );
            var desc1631 = new ActionDescriptor();
            var idnull = charIDToTypeID( "null" );
                var ref772 = new ActionReference();
                var idLyr = charIDToTypeID( "Lyr " );
                ref772.putName( idLyr, "TSTCYN" );
            desc1631.putReference( idnull, ref772 );
            var idMkVs = charIDToTypeID( "MkVs" );
            desc1631.putBoolean( idMkVs, false );
            var idLyrI = charIDToTypeID( "LyrI" );
                var list245 = new ActionList();
                list245.putInteger( 2582 );
            desc1631.putList( idLyrI, list245 );
            executeAction( idslct, desc1631, DialogModes.NO );
                
            //CURVE NAME
            var idsetd = charIDToTypeID( "setd" );
            var desc258 = new ActionDescriptor();
            var idnull = charIDToTypeID( "null" );
            var ref59 = new ActionReference();
            var idLyr = charIDToTypeID( "Lyr " );
            var idOrdn = charIDToTypeID( "Ordn" );
            var idTrgt = charIDToTypeID( "Trgt" );
            ref59.putEnumerated( idLyr, idOrdn, idTrgt );
            desc258.putReference( idnull, ref59 );
            var idT = charIDToTypeID( "T   " );
            var desc259 = new ActionDescriptor();
            var idNm = charIDToTypeID( "Nm  " );
            desc259.putString( idNm, """Cyan""" );
            var idLyr = charIDToTypeID( "Lyr " );
            desc258.putObject( idT, idLyr, desc259 );
            executeAction( idsetd, desc258, DialogModes.NO );
                }
                catch(e){
                }
        try{
            // =======================================================
            var idslct = charIDToTypeID( "slct" );
            var desc1631 = new ActionDescriptor();
            var idnull = charIDToTypeID( "null" );
                var ref772 = new ActionReference();
                var idLyr = charIDToTypeID( "Lyr " );
                ref772.putName( idLyr, "TSTMGNT" );
            desc1631.putReference( idnull, ref772 );
            var idMkVs = charIDToTypeID( "MkVs" );
            desc1631.putBoolean( idMkVs, false );
            var idLyrI = charIDToTypeID( "LyrI" );
                var list245 = new ActionList();
                list245.putInteger( 2582 );
            desc1631.putList( idLyrI, list245 );
            executeAction( idslct, desc1631, DialogModes.NO );
                
            //CURVE NAME
            var idsetd = charIDToTypeID( "setd" );
            var desc258 = new ActionDescriptor();
            var idnull = charIDToTypeID( "null" );
            var ref59 = new ActionReference();
            var idLyr = charIDToTypeID( "Lyr " );
            var idOrdn = charIDToTypeID( "Ordn" );
            var idTrgt = charIDToTypeID( "Trgt" );
            ref59.putEnumerated( idLyr, idOrdn, idTrgt );
            desc258.putReference( idnull, ref59 );
            var idT = charIDToTypeID( "T   " );
            var desc259 = new ActionDescriptor();
            var idNm = charIDToTypeID( "Nm  " );
            desc259.putString( idNm, """Magenta""" );
            var idLyr = charIDToTypeID( "Lyr " );
            desc258.putObject( idT, idLyr, desc259 );
            executeAction( idsetd, desc258, DialogModes.NO );
                }
                catch(e){
                }
        try{
    // =======================================================
    var idslct = charIDToTypeID( "slct" );
    var desc1631 = new ActionDescriptor();
    var idnull = charIDToTypeID( "null" );
        var ref772 = new ActionReference();
        var idLyr = charIDToTypeID( "Lyr " );
        ref772.putName( idLyr, "TSTYLLW" );
    desc1631.putReference( idnull, ref772 );
    var idMkVs = charIDToTypeID( "MkVs" );
    desc1631.putBoolean( idMkVs, false );
    var idLyrI = charIDToTypeID( "LyrI" );
        var list245 = new ActionList();
        list245.putInteger( 2582 );
    desc1631.putList( idLyrI, list245 );
    executeAction( idslct, desc1631, DialogModes.NO );
        
    //CURVE NAME
    var idsetd = charIDToTypeID( "setd" );
    var desc258 = new ActionDescriptor();
    var idnull = charIDToTypeID( "null" );
    var ref59 = new ActionReference();
    var idLyr = charIDToTypeID( "Lyr " );
    var idOrdn = charIDToTypeID( "Ordn" );
    var idTrgt = charIDToTypeID( "Trgt" );
    ref59.putEnumerated( idLyr, idOrdn, idTrgt );
    desc258.putReference( idnull, ref59 );
    var idT = charIDToTypeID( "T   " );
    var desc259 = new ActionDescriptor();
    var idNm = charIDToTypeID( "Nm  " );
    desc259.putString( idNm, """Yellow""" );
    var idLyr = charIDToTypeID( "Lyr " );
    desc258.putObject( idT, idLyr, desc259 );
    executeAction( idsetd, desc258, DialogModes.NO );
        }
        catch(e){
        }
        
    try{
        // =======================================================
    var idslct = charIDToTypeID( "slct" );
    var desc1631 = new ActionDescriptor();
    var idnull = charIDToTypeID( "null" );
        var ref772 = new ActionReference();
        var idLyr = charIDToTypeID( "Lyr " );
        ref772.putName( idLyr, "TSTBLCK" );
    desc1631.putReference( idnull, ref772 );
    var idMkVs = charIDToTypeID( "MkVs" );
    desc1631.putBoolean( idMkVs, false );
    var idLyrI = charIDToTypeID( "LyrI" );
        var list245 = new ActionList();
        list245.putInteger( 2582 );
    desc1631.putList( idLyrI, list245 );
    executeAction( idslct, desc1631, DialogModes.NO );
    
    //CURVE NAME
    var idsetd = charIDToTypeID( "setd" );
    var desc258 = new ActionDescriptor();
    var idnull = charIDToTypeID( "null" );
    var ref59 = new ActionReference();
    var idLyr = charIDToTypeID( "Lyr " );
    var idOrdn = charIDToTypeID( "Ordn" );
    var idTrgt = charIDToTypeID( "Trgt" );
    ref59.putEnumerated( idLyr, idOrdn, idTrgt );
    desc258.putReference( idnull, ref59 );
    var idT = charIDToTypeID( "T   " );
    var desc259 = new ActionDescriptor();
    var idNm = charIDToTypeID( "Nm  " );
    desc259.putString( idNm, """Black""" );
    var idLyr = charIDToTypeID( "Lyr " );
    desc258.putObject( idT, idLyr, desc259 );
    executeAction( idsetd, desc258, DialogModes.NO );
    }
    catch(e){
    }
    
    // =======================================================
    ///// select layer
    var idslct = charIDToTypeID( "slct" );
    var desc1639 = new ActionDescriptor();
    var idnull = charIDToTypeID( "null" );
        var ref779 = new ActionReference();
        var idLyr = charIDToTypeID( "Lyr " );
        ref779.putName( idLyr, "TSTMAXCLRS" );
    desc1639.putReference( idnull, ref779 );
    var idMkVs = charIDToTypeID( "MkVs" );
    desc1639.putBoolean( idMkVs, false );
    var idLyrI = charIDToTypeID( "LyrI" );
        var list248 = new ActionList();
        list248.putInteger( 2571 );
    desc1639.putList( idLyrI, list248 );
    executeAction( idslct, desc1639, DialogModes.NO );
    
    //CLIPPING CURVE
    
    var idGrpL = charIDToTypeID( "GrpL" );
       var desc22 = new ActionDescriptor();
       var idnull = charIDToTypeID( "null" );
           var ref5 = new ActionReference();
           var idLyr = charIDToTypeID( "Lyr " );
           var idOrdn = charIDToTypeID( "Ordn" );
           var idTrgt = charIDToTypeID( "Trgt" );
           ref5.putEnumerated( idLyr, idOrdn, idTrgt );
       desc22.putReference( idnull, ref5 );
    executeAction( idGrpL, desc22, DialogModes.NO );
    app.activeDocument.activeLayer.remove()

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines