Quantcast
Channel: Adobe Community : Popular Discussions - Photoshop Scripting
Viewing all articles
Browse latest Browse all 12244

Marquee tool selection help

$
0
0

Hi,

 

When we select object via marquee tool, I need to cut this object and paste at the same place as layer 1 and resize the object to 10 % and re select the second object and do the same process.

 

But i am unable to do this process.

 

Please find the below, any help is much appreciated.

 

var aDoc = app.activeDocument;

var Sel = aDoc.selection;

// =======================================================

var idCpTL = charIDToTypeID( "CpTL" );

executeAction( idCpTL, undefined, DialogModes.NO );

// =======================================================

var idslct = charIDToTypeID( "slct" );

    var desc16 = new ActionDescriptor();

    var idnull = charIDToTypeID( "null" );

        var ref10 = new ActionReference();

        var idLyr = charIDToTypeID( "Lyr " );

        ref10.putName( idLyr, "Layer 1" );

    desc16.putReference( idnull, ref10 );

    var idMkVs = charIDToTypeID( "MkVs" );

    desc16.putBoolean( idMkVs, false );

executeAction( idslct, desc16, DialogModes.NO );

aDoc.activeLayer.resize(105,105, AnchorPosition.MIDDLECENTER)

alert ("OK", "Test")

 

 

//How to select the second object help needed //

 

// =======================================================

var idCpTL = charIDToTypeID( "CpTL" );

executeAction( idCpTL, undefined, DialogModes.NO );

 

var idslct = charIDToTypeID( "slct" );

    var desc25 = new ActionDescriptor();

    var idnull = charIDToTypeID( "null" );

        var ref18 = new ActionReference();

        var idLyr = charIDToTypeID( "Lyr " );

        ref18.putName( idLyr, "Layer 2" );

    desc25.putReference( idnull, ref18 );

    var idMkVs = charIDToTypeID( "MkVs" );

    desc25.putBoolean( idMkVs, false );

executeAction( idslct, desc25, DialogModes.NO );

 

 

aDoc.activeLayer.resize(105,105, AnchorPosition.MIDDLECENTER)

 

 

// =======================================================

var idCpTL = charIDToTypeID( "CpTL" );

executeAction( idCpTL, undefined, DialogModes.NO );

 

 

var idslct = charIDToTypeID( "slct" );

    var desc30 = new ActionDescriptor();

    var idnull = charIDToTypeID( "null" );

        var ref22 = new ActionReference();

        var idLyr = charIDToTypeID( "Lyr " );

        ref22.putName( idLyr, "Layer 3" );

    desc30.putReference( idnull, ref22 );

    var idMkVs = charIDToTypeID( "MkVs" );

    desc30.putBoolean( idMkVs, false );

executeAction( idslct, desc30, DialogModes.NO );

 

aDoc.activeLayer.resize(105,105, AnchorPosition.MIDDLECENTER)

 

regards,

Vinoth


Viewing all articles
Browse latest Browse all 12244

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>