Page 1 of 1

Get layer name

Posted: Mon Nov 05, 2012 10:06 pm
by GuyOxford
I am writing an extension for Photoshop using Flash Builder and Extension builder 2.

I would like to query the Photoshop app which layer, by name, is currently selected. Is this possible? I would also like to know what the opacity is currently set to for the same layer. I'm guessing that would be a similar query.

All help greatly appreciated.

Get layer name

Posted: Tue Nov 06, 2012 9:17 pm
by GuyOxford
I've found the answer to this. For anyone else trying to solve this: -

public static var app:Application = Photoshop.app;
public static var docRef:Document = app.activeDocument;

var name:String = docRef.activeLayer.name;
var opacity:Number = docRef.activeLayer.opacity;