Code: Select all
var d = new ActionDescriptor();
d.putUnitDouble(stringIDToTypeID("width"), stringIDToTypeID("distanceUnit"), 200);//I want to change for mm
d.putUnitDouble(stringIDToTypeID("height"), stringIDToTypeID("distanceUnit"), 200);//I want to change for mm
d.putEnumerated(stringIDToTypeID("horizontal"), stringIDToTypeID("horizontalLocation"), stringIDToTypeID("left"));
d.putEnumerated(stringIDToTypeID("vertical"), stringIDToTypeID("verticalLocation"), stringIDToTypeID("top"));
executeAction(stringIDToTypeID("canvasSize"), d, DialogModes.NO);
Of course can also be a cm