Copy link to clipboard
Copied
Hi, I am new in Js and so far I am capable of applying styles on artLayers with Js.
This is my code for that
app.activeDocument.artLayers["artLayer Name"].applyStyle("Name of the Style");
But I don't know how to apply a style on the active layerSet. It will be really helpful to apply a style on a folder because that way I will apply the same effect in all the layerSet's contents.
Can you help me?
layer sets does not have the method applyStyle().
But you can do the same with ActionManager code (it's JavaScript compatible)
...var yourStyle = "Pyramide"; // your own style name
var laySet = "Gruppe 1"; // your own layer set name
(ref1 = new ActionReference()).putName(stringIDToTypeID('style'), yourStyle);
(desc = new ActionDescriptor()).putReference(stringIDToTypeID('null'), ref1);
(ref2 = new ActionReference()).putName(stringIDToTypeID('layer'), laySet)
desc.putReference(stri
Copy link to clipboard
Copied
layer sets does not have the method applyStyle().
But you can do the same with ActionManager code (it's JavaScript compatible)
var yourStyle = "Pyramide"; // your own style name
var laySet = "Gruppe 1"; // your own layer set name
(ref1 = new ActionReference()).putName(stringIDToTypeID('style'), yourStyle);
(desc = new ActionDescriptor()).putReference(stringIDToTypeID('null'), ref1);
(ref2 = new ActionReference()).putName(stringIDToTypeID('layer'), laySet)
desc.putReference(stringIDToTypeID('to'), ref2)
desc.putBoolean(stringIDToTypeID('group'), true)
executeAction(stringIDToTypeID('applyStyle'), desc, DialogModes.NO);
The previous code will apply the (existing!) style with name "Pyramide" to the layer set with name "Gruppe 1"
Have fun
Copy link to clipboard
Copied
Thank you very much my friend! That did the trick!