Code: Select all
var d = new ActionDescriptor();
d.putEnumerated(stringIDToTypeID("freeTransformCenterState"), stringIDToTypeID("quadCenterState"), stringIDToTypeID("QCSAverage"));
var d1 = new ActionDescriptor();
d1.putUnitDouble(stringIDToTypeID("horizontal"), stringIDToTypeID("pixelsUnit"), 0);
d1.putUnitDouble(stringIDToTypeID("vertical"), stringIDToTypeID("pixelsUnit"), 0);
d.putObject(stringIDToTypeID("offset"), stringIDToTypeID("offset"), d1);
d.putUnitDouble(stringIDToTypeID("width"), stringIDToTypeID("px"), 200);
d.putUnitDouble(stringIDToTypeID("height"), stringIDToTypeID("px"), 200);
var d2 = new ActionDescriptor();
var r = new ActionReference();
r.putIdentifier(stringIDToTypeID("layer"), 3);
d2.putReference(stringIDToTypeID("from"), r);
var r1 = new ActionReference();
r1.putIdentifier(stringIDToTypeID("layer"), 3);
d2.putReference(stringIDToTypeID("to"), r1);
d.putObject(stringIDToTypeID("replaceLayer"), stringIDToTypeID("transform"), d2);
executeAction(stringIDToTypeID("transform"), d, DialogModes.NO);
How to become a 200 pixels