Answered
Alert to get below layer name under current later shape
i need to make alert for any current layer this alert get below layer name the same example on below image .. and the same this if current layer shape or text ..and thanks alot

i need to make alert for any current layer this alert get below layer name the same example on below image .. and the same this if current layer shape or text ..and thanks alot

I don't know if this is what you are looking for or not... The code is more of a proof of concept than anything:
var doc = app.activeDocument;
var oLayer = doc.activeLayer;
selectNextVisibleLayer(false);
function selectNextVisibleLayer(makeVisible) {
var c2t = function (s) {
return app.charIDToTypeID(s);
};
var s2t = function (s) {
return app.stringIDToTypeID(s);
};
var descriptor = new ActionDescriptor();
var list = new ActionList();
var reference = new ActionReference();
reference.putEnumerated(s2t("layer"), s2t("ordinal"), s2t("backwardEnum"));
descriptor.putReference(c2t("null"), reference);
descriptor.putBoolean(s2t("makeVisible"), makeVisible);
list.putInteger(3);
descriptor.putList(s2t("layerID"), list);
executeAction(s2t("select"), descriptor, DialogModes.NO);
}
var nLayer = doc.activeLayer.name;
doc.activeLayer = oLayer;
alert(nLayer);
As JJMack noted: "what happens if the lowest layer is selected?"... In the case of this script, the top layer is returned!
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.