Skip to main content
Participating Frequently
January 13, 2016
Question

Where are Layer Style parameters stored in a copied Layer?

  • January 13, 2016
  • 2 replies
  • 292 views

Hi,

I'm using Javascript with Photoshop CS6.

Suppose there is a layer that has a layer style attached to it. If this layer is duplicated using Javascript, the layer style exists in the new layer object. So clearly the layer style plus its parameters are copied into the newly copied layer somewhere.

I want to be able to access and modify the parameters of the layer style in the newly-created/newly-copied layer. I've tried using the data browser to find where they are but I just can't find my way around the objects enough to find where the layer style name and parameters are stored. Could someone possibly help me with this please?

Thanks in anticipation.

This topic has been closed for replies.

2 replies

DocH999Author
Participating Frequently
January 15, 2016

So I've installed scriptlistener and stored a and looked at a few sample resulting scripts.

I'm attempting to do what I thought what be a pretty straightforward thing: change the angle of the shadow used in the Drop Shadow layer style, in a current, existing layer style in an existing layer.

It turns out that this is a lot more complex than I imagined...

I've incorporated the following code from a scriptlistener output file into a javascript file:

var newDesc = new ActionDescriptor()

...

    var idsetd = charIDToTypeID( "setd" );

    var idlagl = charIDToTypeID( "lagl" );

    var idAng = charIDToTypeID( "#Ang" );

    newDesc.putUnitDouble( idlagl, idAng, shadowangle );

    executeAction( idsetd, newDesc, DialogModes.NO );

and it doesn't crash but it doesn't do anything either(!) As I've explained, I'm a beginner at javascript, and to thinking in object-oriented terms, so this may be a ridiculous bit of code with glaring errors - if you can see you way clear to giving me  hand I'd be grateful.

JJMack
Community Expert
Community Expert
January 13, 2016

You may want to look at this thread I found searching this forum.  These experts state  it not easy for may reasons.

Get layer style parameters?

JJMack
DocH999Author
Participating Frequently
January 13, 2016

Hey, thanks JJ.

Does look rather complicated.  Will have to explore the JSON Action Manager stuff mentioned in that thread - could be just the thing.

All the best,