There's no a function like this in vanilla Photoshop to my knowledge, I'd go with a script: it's quite straightforward. The idea is to iterate through selected layers and proportionally scale them depending on their height.
Here's the script result (I was changing all layers to height of 50px):
And the script itself. To use it save this to a FileName.jsx
to your Photoshop/Presets/Scripts
folder, restart PS and you'll find name in the File > Scripts > FileName
menu.
var size = 50; // result height
var layers = getLayers();
for (var i = 0; i < layers.length; i++)
{
selectById(layers[i].id)
transform(layers[i], size)
}
function selectById(id)
{
var desc1 = new ActionDescriptor();
var ref1 = new ActionReference();
ref1.putIdentifier(charIDToTypeID('Lyr '), id);
desc1.putReference(charIDToTypeID('null'), ref1);
executeAction(charIDToTypeID('slct'), desc1, DialogModes.NO);
return this;
}
function getLayers()
{
var lyrs = [];
var lyr;
var ref = new ActionReference();
var desc;
var bounds;
var tempIndex;
var ref2;
ref.putProperty(stringIDToTypeID("property"), stringIDToTypeID("targetLayers"));
ref.putEnumerated(charIDToTypeID('Dcmn'), charIDToTypeID('Ordn'), charIDToTypeID('Trgt'));
var targetLayers = executeActionGet(ref).getList(stringIDToTypeID("targetLayers"));
for (var i = 0; i < targetLayers.count; i++)
{
lyr = {};
tempIndex = 0;
ref2 = new ActionReference();
try
{
activeDocument.backgroundLayer;
ref2.putIndex(charIDToTypeID('Lyr '), targetLayers.getReference(i).getIndex());
desc = executeActionGet(ref2);
tempIndex = desc.getInteger(stringIDToTypeID("itemIndex")) - 1;
}
catch (o)
{
ref2.putIndex(charIDToTypeID('Lyr '), targetLayers.getReference(i).getIndex() + 1);
desc = executeActionGet(ref2);
tempIndex = desc.getInteger(stringIDToTypeID("itemIndex"));
}
bounds = desc.getObjectValue(stringIDToTypeID("bounds"));
lyr.id = desc.getInteger(stringIDToTypeID("layerID"));
lyr.height = bounds.getDouble(stringIDToTypeID("height"));
lyr.width = bounds.getDouble(stringIDToTypeID("width"));
lyrs.push(lyr);
}
return lyrs;
}
function transform(layer, size)
{
var sizeValue = size / layer.height * 100;
var desc = new ActionDescriptor();
var ref = new ActionReference();
ref.putEnumerated(cTID('Lyr '), cTID('Ordn'), cTID('Trgt'));
desc.putReference(cTID('null'), ref);
desc.putEnumerated(cTID('FTcs'), cTID('QCSt'), cTID('Qcsa'));
desc.putUnitDouble(cTID('Wdth'), cTID('#Prc'), sizeValue);
desc.putUnitDouble(cTID('Hght'), cTID('#Prc'), sizeValue);
desc.putEnumerated(cTID('Intr'), cTID('Intp'), cTID('Blnr'));
executeAction(cTID('Trnf'), desc, DialogModes.NO);
} // end of transform()