Skip to main content
c.pfaffenbichler
Community Expert
Community Expert
July 3, 2009
Answered

how to assess blend if-settings with javascript

  • July 3, 2009
  • 1 reply
  • 3087 views

Some time ago someone in the MacIntosh-forum declared their wish to use a layer’s Layer Style Blend If-setting’s result as a mask (for whatever reasons).

The »This Layer’s« effect is easily enough converted to a mask by grouping and flattening the layer and using the resulting transparency.

But the »Underlying Layer«-setting seems more difficult (naturally as they depend on other layers’ content).

Is there a way to get the current (for an RGB-file 32) numbers of a layer’s Blend If-settings with JavaScript?

Or is there a way to reset the This Layer-Blend If-settings, but leave the Underlying Layer-settings unchanged?

Any help appreciated.

This topic has been closed for replies.
Correct answer xbytor2
It seems that I was wrong. The blending options are not part of the layerEffects descriptor. At least not in CS4. There was a time when you had to use a script by Xbytor named Styles.js to get the layerEffects descriptor. I tried that as well and it also doesn't return any blend settings.

The Blending Options are stored as part of the Style when you save the Style as a preset and/or save it to disk as a .asl file. Take a peek with a hex editor.

That information was not being read in (via Styles.js) as a part of the Style Descriptor. I've updated Styles.js so that you can now get the Blend Options descriptor:


http://ps-scripts.com/bb/viewtopic.php?t=2759

-X

1 reply

Inspiring
July 3, 2009

The blend if settings are part of the layer's effects descriptor. You can get the current setting from a layer and/or change those settings using the Action Manager API.

I don't fully understand what you are trying to do. Although you can get the Underlying Layer numbers they still depend on the other layer and I think would be hard to set with a script.

If you need help with the scriptlistner code to get and set those values let me know.

Inspiring
July 3, 2009

It seems that I was wrong. The blending options are not part of the layerEffects descriptor. At least not in CS4. There was a time when you had to use a script by Xbytor named Styles.js to get the layerEffects descriptor. I tried that as well and it also doesn't return any blend settings.

xbytor2Correct answer
Inspiring
July 3, 2009
It seems that I was wrong. The blending options are not part of the layerEffects descriptor. At least not in CS4. There was a time when you had to use a script by Xbytor named Styles.js to get the layerEffects descriptor. I tried that as well and it also doesn't return any blend settings.

The Blending Options are stored as part of the Style when you save the Style as a preset and/or save it to disk as a .asl file. Take a peek with a hex editor.

That information was not being read in (via Styles.js) as a part of the Style Descriptor. I've updated Styles.js so that you can now get the Blend Options descriptor:


http://ps-scripts.com/bb/viewtopic.php?t=2759

-X