Copy link to clipboard
Copied
I want to apply a red glow with 75 opacity and 5 spread to the selected layer.
Can I do it in javaScript ? Is this possible ?
Copy link to clipboard
Copied
ArtLayer.applyDiffuseGlow ?
If that's not it, try ScriptListener.
Copy link to clipboard
Copied
Glow can be recorded as action step. Later you can convert to JavaScript using Xtools https://ps-scripts.sourceforge.net/xtools.html (ActionFileToJavascript). Maybe @c.pfaffenbichler and @Stephen Marsh can help further.
Copy link to clipboard
Copied
@Bojan Živković - let's see how @defaultseiiesa394z4 goes with the ScriptingListener plug-in first. @willcampbell7 has a video on it here:
Copy link to clipboard
Copied
If I remember correctly using the »plain« code that applies one Layer Style could replace existing Layer Styles, though.
If the Layers in question definitely have no Layer Styles applied then would naturally not be problem.
Copy link to clipboard
Copied
@c.pfaffenbichler – Good point, the implementation of Layer Styles makes it hard to work with existing styles via scripting.
Copy link to clipboard
Copied
@Stephen Marsh Thanks for the shout-out. User didn't indicate size. I used 20. Here's what I came up with. I added comments for where to adjust some values.
var desc1 = new ActionDescriptor();
var ref1 = new ActionReference();
ref1.putProperty(charIDToTypeID('Prpr'), charIDToTypeID('Lefx'));
ref1.putEnumerated(charIDToTypeID('Lyr '), charIDToTypeID('Ordn'), charIDToTypeID('Trgt'));
desc1.putReference(charIDToTypeID('null'), ref1);
var desc2 = new ActionDescriptor();
desc2.putUnitDouble(charIDToTypeID('Scl '), charIDToTypeID('#Prc'), 100);
var desc3 = new ActionDescriptor();
desc3.putBoolean(charIDToTypeID('enab'), true);
desc3.putBoolean(stringIDToTypeID("present"), true);
desc3.putBoolean(stringIDToTypeID("showInDialog"), true);
desc3.putEnumerated(charIDToTypeID('Md '), charIDToTypeID('BlnM'), charIDToTypeID('Mltp')); // <---- Blend multiply
var desc4 = new ActionDescriptor();
desc4.putDouble(charIDToTypeID('Rd '), 255); // <---- Red
desc4.putDouble(charIDToTypeID('Grn '), 0); // <---- Green
desc4.putDouble(charIDToTypeID('Bl '), 0); // <---- Blue
desc3.putObject(charIDToTypeID('Clr '), stringIDToTypeID("RGBColor"), desc4);
desc3.putUnitDouble(charIDToTypeID('Opct'), charIDToTypeID('#Prc'), 75); // <---- Opacity
desc3.putEnumerated(charIDToTypeID('GlwT'), charIDToTypeID('BETE'), charIDToTypeID('SfBL'));
desc3.putUnitDouble(charIDToTypeID('Ckmt'), charIDToTypeID('#Pxl'), 5); // <---- Spread
desc3.putUnitDouble(charIDToTypeID('blur'), charIDToTypeID('#Pxl'), 20); // <---- Size
desc3.putUnitDouble(charIDToTypeID('Nose'), charIDToTypeID('#Prc'), 0); // <---- Noise
desc3.putUnitDouble(charIDToTypeID('ShdN'), charIDToTypeID('#Prc'), 0);
desc3.putBoolean(charIDToTypeID('AntA'), false);
var desc5 = new ActionDescriptor();
desc5.putString(charIDToTypeID('Nm '), "Linear");
desc3.putObject(charIDToTypeID('TrnS'), charIDToTypeID('ShpC'), desc5);
desc3.putUnitDouble(charIDToTypeID('Inpr'), charIDToTypeID('#Prc'), 50);
desc2.putObject(charIDToTypeID('OrGl'), charIDToTypeID('OrGl'), desc3);
desc1.putObject(charIDToTypeID('T '), charIDToTypeID('Lefx'), desc2);
executeAction(charIDToTypeID('setd'), desc1, DialogModes.NO);
Copy link to clipboard
Copied
So how did you go with the SL plug-in?
Find more inspiration, events, and resources on the new Adobe Community
Explore Now