-
1. Re: Get Layer Name
Joe Tam Nov 6, 2012 2:26 AM (in response to GuyOX4)Hi,
I have not tested my suggestions below but by looking at the API briefly I have discovered these properties:
You can obtain a Layers object from your Document object, which you can then obtain a Layer by name using getByName(name).
As for the opacity, try calling fillOpacity() once you have obtained your Layer object by name.
Hope that helps,
Joe
-
2. Re: Get Layer Name
GuyOX4 Nov 6, 2012 3:28 AM (in response to Joe Tam)Thanks Joe but I don't think that is the answer:
I believe that the function getByName(name) is for selecting a layer by name, not for getting the selected layer's name, and the fillOpacity() function is for setting or reading the Fill opacity, not the layer opacity.
Thanks anyway
. -
3. Re: Get Layer Name
Joe Tam Nov 6, 2012 3:37 AM (in response to GuyOX4)Apologies for misunderstanding your question.
Try:
document.activeLayer().name();
Joe
-
4. Re: Get Layer Name
GuyOX4 Nov 6, 2012 1:16 PM (in response to Joe Tam)Thanks Joe, that is almost right... no need for the brackets:
var name:String = docRef.activeLayer.name;
var opacity:Number = docRef.activeLayer.opacity;Thanks for pointing me in the right direction.


