Get layer name

General Discussion of Scripting for Flex, Flash & CS SDK

Moderators: Tom, Kukurykus

GuyOxford

Get layer name

Post 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.

Professional AI Audio Generation within Adobe Premiere Pro - Download Free Plugin here

GuyOxford

Get layer name

Post 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;