Quantcast
Channel: Adobe Community : Discussion List - All Communities
Viewing all articles
Browse latest Browse all 238792

Get a list of available styles before applying them

$
0
0

Hi,

I used screen listener to create a function which applies layer style to a group.

Is there a way to produce a list of all layer styes, currently loaded/existing in the application?

I what to check if the style exist before applying it.

 

function applyStyleToGroup(style) {
var c2t = function (s) {
return app.charIDToTypeID(s);
};


var s2t = function (s) {
return app.stringIDToTypeID(s);
};


var descriptor = new ActionDescriptor();
var reference = new ActionReference();
var reference2 = new ActionReference();


reference.putName( s2t( "style" ), style);
descriptor.putReference( c2t( "null" ), reference );
reference2.putEnumerated( s2t( "layer" ), s2t( "ordinal" ), s2t( "targetEnum" ));
descriptor.putReference( s2t( "to" ), reference2 );
descriptor.putBoolean( s2t( "group" ), true );
executeAction( s2t( "applyStyle" ), descriptor, DialogModes.NO );
}//applyStyleToGroup

Viewing all articles
Browse latest Browse all 238792

Trending Articles