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:
Here's what I get:
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 );