Something like this
try { if (arguments.length >= 2) { var desc = arguments[0]; var event = arguments[1]; // make sure it's the hide event if (event == charIDToTypeID('Hd ')) { // get the list of what was hidden var list = desc.getList(charIDToTypeID('null')); // get the actionReference for what was hidden var ref = list.getReference(0); // get it's Photoshop class var psClass = ref.getDesiredClass(); // make sure it was a layer that was hidded and do something with the layerName if(psClass == charIDToTypeID('Lyr ')) alert(ref.getName()); } }
} catch (e) { alert( "Error: " + e + ":" + e.line );
}