I am trying to retrieve the transformation information on a layer through script (for a smart object if it matters).
I've been able to do it if there is a text layer attached, but I need to be able to do it with just the smart object.
This is what I have so far:
var idnull = charIDToTypeID("null");
var layerReference = new ActionReference();
layerReference.putEnumerated(charIDToTypeID("Lyr "), charIDToTypeID("Ordn"), charIDToTypeID("Trgt"));
var layerDescriptor = new ActionDescriptor();
layerDescriptor.putReference(idnull, layerReference);
layerDescriptor.putEnumerated(charIDToTypeID("FTcs"), charIDToTypeID("QCSt"), charIDToTypeID("Qcsa"));
var transformDescriptor = app.executeAction(charIDToTypeID("Trnf"), layerDescriptor, DialogModes.NO);
var offset= transformDescriptor.getObjectValue(charIDToTypeID("Ofst"));
var horizontalOffset = offset.getUnitDoubleValue(charIDToTypeID("Hrzn"));
var verticalOffset = offset.getUnitDoubleValue(charIDToTypeID("Vrtc"));
However, horizontalOffset and verticalOffset are both returned as zero.
Thanks in advance, Mark.