Action Manager: get Layer by Index
Hi,
does anyone know how to get the layer (object reference) by it's index (action manager index)?
I've googled for quite a long time but all I can find is something like
function getLayerNameByIndex( idx ) {
var ref = new ActionReference();
ref.putProperty( charIDToTypeID("Prpr") , charIDToTypeID( "Nm " ));
ref.putIndex( charIDToTypeID( "Lyr " ), idx );
return executeActionGet(ref).getString(charIDToTypeID( "Nm " ));;
};
however I don't need the name or id of the layer, I need the layer object itself..
My tries of altering the above code weren't successfull unfortunately.
