get name of selected layercomp

Discussion of Photoshop Scripting, Photoshop Actions and Photoshop Automation in General

Moderators: Tom, Kukurykus

Luke

get name of selected layercomp

Post by Luke »

Hello.

For a special workflow i need to get the name or the number of the active layercomp.
I have tried a lot different calls for that but nothing will work. The ref. is still not very helpfull on that.
Is there someone out who can drop me the line of code?

Best Regards
Luke

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

Mike Hale

get name of selected layercomp

Post by Mike Hale »

You loop through the layerComp collection and check to see if any have their selected property set to true.

Code: Select allvar sourceDoc = app.activeDocument;
for( var c = 0; c < sourceDoc.layerComps.length; c++ ){
     if( sourceDoc.layerComps[c].selected == true ) // do whatever
}