Get layer styles

Anyone, especially newbies, asking for help with Photoshop Scripting and Photoshop Automation - as opposed to those contributing to discussion about an aspect of Photoshop Scripting

Moderators: Tom, Kukurykus

shazdeh

Get layer styles

Post by shazdeh »

How to get a layer's styles values?
I found a topic in adobe's forum (which in turn led me to here) but there was only 3 functions: getStrokeSize, getStrokeColor, getGradientInfo. And its not gonna be helped by looking at the code and try to guess how to get other properties. The code it cryptic. So, does anyone know how to get details about layer styles?
Or, any help on how these 3 functions work so I can get it from there and expand the functions?

here's the getStrokeSize function:
Code: Select allfunction getStrokeSize(){
    try{
        var ref = new ActionReference();
        ref.putEnumerated( charIDToTypeID("Lyr "), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") );
        var desc = executeActionGet(ref).getObjectValue(stringIDToTypeID('layerEffects')).getObjectValue(stringIDToTypeID('frameFX'));
        return desc.getUnitDoubleValue(stringIDToTypeID('size'));
    }catch(e){}
};


Why phtotoshop DOM does not allow something like this?
Code: Select alllayer.styles.dropShadow.distance
mackry

Get layer styles

Post by mackry »

Check out this thread: bb/viewtopic.php?p=9968

It's possible using xbytor's Style.js script.