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

Scripting New Crop Tool

$
0
0

I'm having a difficult time scripting the new crop tool.  Despite specifying the initial 4 corners, it quickly expands to fill the entire document before anyone can use it.  Any suggestiong on how to fix this??

 

Here's what I want:

 

Screen Shot 2014-02-26 at 2.33.56 PM.jpg

 

Here's what I get:

 

Screen Shot 2014-02-26 at 2.33.48 PM.jpg

 

Hee's my code:

 

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

var idCrop = charIDToTypeID( "Crop" );

    var desc142 = new ActionDescriptor();

    var idT = charIDToTypeID( "T   " );

        var desc143 = new ActionDescriptor();

        var idTop = charIDToTypeID( "Top " );

        var idPxl = charIDToTypeID( "#Pxl" );

        desc143.putUnitDouble( idTop, idPxl, 100 );

        var idLeft = charIDToTypeID( "Left" );

        var idPxl = charIDToTypeID( "#Pxl" );

        desc143.putUnitDouble( idLeft, idPxl, 100 );

        var idBtom = charIDToTypeID( "Btom" );

        var idPxl = charIDToTypeID( "#Pxl" );

        desc143.putUnitDouble( idBtom, idPxl, 200 );

        var idRght = charIDToTypeID( "Rght" );

        var idPxl = charIDToTypeID( "#Pxl" );

        desc143.putUnitDouble( idRght, idPxl, 200 );

    var idRctn = charIDToTypeID( "Rctn" );

    desc142.putObject( idT, idRctn, desc143 );

    var idAngl = charIDToTypeID( "Angl" );

    var idAng = charIDToTypeID( "#Ang" );

    desc142.putUnitDouble( idAngl, idAng, 0.000000 );

    var idDlt = charIDToTypeID( "Dlt " );

    desc142.putBoolean( idDlt, true );

    var idcropAspectRatioModeKey = stringIDToTypeID( "cropAspectRatioModeKey" );

    var idcropAspectRatioModeClass = stringIDToTypeID( "cropAspectRatioModeClass" );

    var idunconstrained = stringIDToTypeID( "unconstrained" );

    desc142.putEnumerated( idcropAspectRatioModeKey, idcropAspectRatioModeClass, idunconstrained );

executeAction( idCrop, desc142, DialogModes.NO );


Viewing all articles
Browse latest Browse all 12244

Trending Articles



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