Вот такое решение у меня получилось
try {
var doc = app.activeDocument;
var maxW = 100, maxH = 100, s = 1;
for( var i = 0 ; i < doc.artLayers.length; i++ ) {
var activeLayer = doc.artLayers.getByName( doc.artLayers[ i ].name );
var orUnits = app.preferences.rulerUnits;
app.preferences.rulerUnits = Units.PERCENT;
var w = parseFloat(activeLayer.bounds[2]) - parseFloat(activeLayer.bounds[0]);
var h = parseFloat(activeLayer.bounds[3]) - parseFloat(activeLayer.bounds[1]);
if (w > h) {
s = maxW / w * 100;
} else {
s = maxH / h * 100;
}
activeLayer.resize( s, s, AnchorPosition.TOPLEFT );
app.preferences.rulerUnits = Units.PIXELS;
w = parseFloat(activeLayer.bounds[2]) - parseFloat(activeLayer.bounds[0]);
h = parseFloat(activeLayer.bounds[3]) - parseFloat(activeLayer.bounds[1]);
var dX = (doc.width - w) / 2 - parseFloat(activeLayer.bounds[0]);
var dY = (doc.height - h) / 2 - parseFloat(activeLayer.bounds[1]);
activeLayer.translate(dX, dY);
app.preferences.rulerUnits = orUnits;
}
}
catch( e ) {
//alert( e );
}