Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Can I use photoshop javaScript to add outerGlow effect to the selected layer ?

Community Beginner ,
Dec 14, 2022 Dec 14, 2022

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 ?

TOPICS
Actions and scripting
707
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
Community Expert ,
Dec 14, 2022 Dec 14, 2022

ArtLayer.applyDiffuseGlow ?

 

If that's not it, try ScriptListener.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 14, 2022 Dec 14, 2022

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 14, 2022 Dec 14, 2022

@Bojan Živković - let's see how @defaultseiiesa394z4 goes with the ScriptingListener plug-in first. @willcampbell7  has a video on it here:

 

https://youtu.be/x_rMhCz-MdQ

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 17, 2022 Dec 17, 2022

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. 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 17, 2022 Dec 17, 2022

@c.pfaffenbichler – Good point, the implementation of Layer Styles makes it hard to work with existing styles via scripting.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Dec 20, 2022 Dec 20, 2022
LATEST

@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);

 

William Campbell
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 19, 2022 Dec 19, 2022

@defaultseiiesa394z4 


So how did you go with the SL plug-in?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines