Get layer style parameters?

How is it possible to set and get layer style parameters? For example read out stroke size, shadow distance, etc...

In case you're still interested about getting and setting layer styles parameters, I've just released a new module jamStyles of my open-source JSON Action Manager scripting library, which provides full support for blending options and layer effects using a fully-documented, simplified JSON object format.
I've also written a quick tutorial showing how to perform a few standard operations, using mainly the two functions jamStyles.getLayerStyle and jamStyles.setLayerStyle.
For instance, the following code sample will set a mildly complex layer style:
var layerStyleObj =
    "blendOptions":
        "fillOpacity": 70,
        "blendInterior": true
    "layerEffects":
        "scale": 100,
        "dropShadow":
            "enabled": true,
            "mode": "multiply",
            "color":
                "red": 0,
                "green": 0,
                "blue": 0
            "opacity": 70,
            "useGlobalAngle": false,
            "localLightingAngle": 90,
            "distance": 6,
            "chokeMatte": 0,
            "blur": 4,
            "noise": 0,
            "antiAlias": false,
            "transparencyShape":
                "name": "Linear",
                "curve":
                        "horizontal": 0,
                        "vertical": 0
                        "horizontal": 255,
                        "vertical": 255
            "layerConceals": true
        "innerShadow":
            "enabled": true,
            "mode": "multiply",
            "color":
                "red": 0,
                "green": 0,
                "blue": 0
            "opacity": 70,
            "useGlobalAngle": false,
            "localLightingAngle": 90,
            "distance": 10,
            "chokeMatte": 15,
            "blur": 20,
            "noise": 0,
            "antiAlias": false,
            "transparencyShape":
                "name": "Linear",
                "curve":
                        "horizontal": 0,
                        "vertical": 0
                        "horizontal": 255,
                        "vertical": 255
        "innerGlow":
            "enabled": true,
            "mode": "linearDodge",
            "color":
                "red": 255,
                "green": 246,
                "blue": 168
            "opacity": 31,
            "glowTechnique": "preciseMatte",
            "chokeMatte": 0,
            "blur": 20,
            "shadingNoise": 0,
            "noise": 0,
            "antiAlias": true,
            "innerGlowSource": "centerGlow",
            "transparencyShape":
                "name": "Half Round",
                "curve":
                        "horizontal": 0,
                        "vertical": 0
                        "horizontal": 29,
                        "vertical": 71
                        "horizontal": 87,
                        "vertical": 167
                        "horizontal": 195,
                        "vertical": 240
                        "horizontal": 255,
                        "vertical": 255
            "inputRange": 43
        "bevelEmboss":
            "enabled": true,
            "highlightMode": "screen",
            "highlightColor":
                "red": 255,
                "green": 255,
                "blue": 255
            "highlightOpacity": 100,
            "shadowMode": "multiply",
            "shadowColor":
                "red": 0,
                "green": 0,
                "blue": 0
            "shadowOpacity": 100,
            "bevelTechnique": "softMatte",
            "bevelStyle": "innerBevel",
            "useGlobalAngle": false,
            "localLightingAngle": 90,
            "localLightingAltitude": 75,
            "strengthRatio": 80,
            "blur": 16,
            "bevelDirection": "stampIn",
            "transparencyShape":
                "name": "Linear",
                "curve":
                        "horizontal": 0,
                        "vertical": 0
                        "horizontal": 255,
                        "vertical": 255
            "antialiasGloss": false,
            "softness": 0,
            "useShape": true,
            "mappingShape":
                "name": "Half Round",
                "curve":
                        "horizontal": 0,
                        "vertical": 0
                        "horizontal": 29,
                        "vertical": 71
                        "horizontal": 87,
                        "vertical": 167
                        "horizontal": 195,
                        "vertical": 240
                        "horizontal": 255,
                        "vertical": 255
            "antiAlias": true,
            "inputRange": 70,
            "useTexture": false
        "solidFill":
            "enabled": true,
            "mode": "normal",
            "opacity": 100,
            "color":
                "red": 0,
                "green": 102,
                "blue": 255
jamStyles.setLayerStyle (layerStyleObj);
And this code will let you read out the drop shadow distance:
var layerStyleObj = jamStyles.getLayerStyle ();
if (layerStyleObj)
    if ("layerEffects" in layerStyleObj)
        var layerEffectsObj = layerStyleObj["layerEffects"];
        if ("dropShadow" in layerEffectsObj)
            var dropShadowObj = layerEffectsObj["dropShadow"];
            alert ("Drop shadow distance: " + dropShadowObj["distance"]);
Actually, if you know for sure that the current layer you're working on has layer effects, including a drop shadow effect, the code can be as short as:
var layerStyleObj = jamStyles.getLayerStyle ();
alert ("Drop shadow distance: " + layerStyleObj["layerEffects"]["dropShadow"]["distance"]);
Or, even shorter, using dot notation:
alert ("Drop shadow distance: " + jamStyles.getLayerStyle ().layerEffects.dropShadow.distance);
HTH,
     --Mikaeru

Similar Messages

  • Get layer style settings from the differences between 2 images.

    Hello People,
    I have a question:
    Is it possible to get the layer style settings when I have 1 image with the layer style and 1 without it.
    Let's say I have an icon that's just a house.
    [img]http://s6.postimage.org/xfpzl5hl9/image.png[/img]
    And I have a house with outer glow.
    [img]http://s6.postimage.org/h6un7v2a5/0_h.png[/img]
    Is it then possible to get the settings used in the outer glow?
    greets Ruud.

    You won't get the actual numerical settings, but if you load both layers in the same document, and change the blend mode of the top layer to Difference, you can see the difference between the two images.  Thus:

  • CS4 extended Layer styles not working

    Running CS4 extended on Vista64, Corei7 quad @2.9 GHz, 8 Gig Ram and nVidia quadro FX 1700. I can not get layer styles to work in documents that originated in CS3 extended. If I start a new document they work.
    Any thoughts?
    Thanks!

    Well, I ended up copying all of the layers from the old PSD to a CS4 psd and it worked. Since it is a web page it had a lot of layers and it was a major pain in the hooey... but it did work.

  • I'm trying to install a layer style (.asl) in photoshop cc 2014 and I get the error message 'Could not place the document 'filename.asl' because no parser or file format can open the file.' Any suggestions?

    I get the same error when trying the same thing with the default styles, so it's not the file.

    So, if you click on one on of the layer style sets already on the list, such as Text Effects 2, you get the same message?
    Which version of mac os x are you using?
    Did you upgrade your mac os with photoshop cc 2014 already installed?
    Do you have the lastest version of photoshop cc 2014, which should be 2014.2.1
    (listed at the top of Help>System Info from within photoshop)
    Do you see the same layer styles as shown above on your list?
    Have you moved/copied any plugins from an earlier version of photoshop to the photoshop cc 2014 plugins folder?
    The layer styles shown on the list above are the styles that ship with cc 2014 and should be in
    /Applications/Adobe Photoshop CC 2014/Presets/Styles
    (the mac applications folder where all the other mac applications are installed)
    You might try resetting the preferences, but you might need to uninstall photoshop cc 2014 and then reinstall.
    (don't drag the cc 2014 to the trash, but use the Uninstall Adobe Photoshop CC 2014 in the photoshop cc 2014 application folder)
    To reset the preferences
    Press and hold down the Shift+Command+Option keys while starting photoshop cc 2014
    Keep holding the keys down until you get a dialog asking if you want to delete the adobe photoshop settings file
    Press Yes

  • Accesing layer styles from a filter plugin

    It's possibile to acces a layer style (ex. drop shadow) from a filter plugin?

    Yes, from an automation plugin you can get the parameters to the layer styles. On the layer object (descriptor) there is a keyLayerEffects, classLayerFXVisible object (descriptor). That has objects (descriptors) such as keyInnerGlow or keyInnerShadow. Build the Getter plug-in and install it. Make your file with your layer effects. Then run getter from the File > Automate > Getter menu and you will get a Getter.log file on your desktop that shows all the things available in your document. Remember that the Getter code is reusing the Listener code so there is a bit more work for using the Getter output. All the ->Put* routines need to be converted to ->Get* routines and you need to invert the order of the calls. Here is some code that I just did this exercise on, in JavaScript, but you should get the idea. This code gets all the brush toolPresets and sees if the Preset I'm looking for is present. You can find the 'keys' in the PITerminology.h and PISTringTerminology.h files in your SDK. 'capp' is classApplication for example. You would want 'Lyr ' for classLayer.
    // find if the following brush is loaded
    FindBrushPresetByName( "foo" ).toString() + " : " + FindBrushPresetByName( "Restore Brush - PA" ).toString();
    function FindBrushPresetByName( brushPresetName ) {
         var ref = new ActionReference();
         var presetManagerStrID = stringIDToTypeID( 'presetManager');
         ref.putProperty( charIDToTypeID( 'Prpr' ), presetManagerStrID );
         ref.putEnumerated( charIDToTypeID( 'capp' ), charIDToTypeID( 'Ordn' ), charIDToTypeID( 'Trgt' ) );
         var desc = executeActionGet( ref );
         if ( desc.count > 0 && desc.hasKey( presetManagerStrID ) ) {
              var list = desc.getList( presetManagerStrID );
              var toolPresetClassID = stringIDToTypeID( 'toolPreset' );
              for ( var i = 0; i < list.count; i++ ) {
                   var listType = list.getObjectType( i );
                   if ( listType == toolPresetClassID ) {
                        var toolDescObj = list.getObjectValue( i );
                        var keyName = charIDToTypeID( 'Nm  ' );
                        if ( toolDescObj.count > 0 && toolDescObj.hasKey( keyName ) ) {
                             var toolNameList = toolDescObj.getList( keyName );
                             for ( var ii = 0; ii < toolNameList.count; ii++ ) {
                                  var toolName = toolNameList.getString( ii );
                                  if ( toolName == brushPresetName ) {
                                       return true;
         return false;
     

  • Installing new layer styles in PSE 7

    What is the correct way to install new layer styles into pse 7? ( I use Vista)
    Do I move my extracted style file into the layer styles folder by following this pathway: program data>adobe>photoshop elements>7.0>photo creations>layer styles.
    Do I need to create a metafile too?
    Thank you for helping me, I have about a dozen styles I need to add, but I am unsure how to get it done properly.

    Hello,
    You need to create a metadata.xml file too to view it in a specific category of your choioce.
    You need to paste the two things :
    1) .asl file.
    2) metadata.xml,
    to the following location:
    C:\ProgramData\Adobe\Photoshop Elements\8.0\Photo Creations\layer styles.
    Here you need to add the two files and relaunch PSE. This will show you the presets in the layer styles category with.
    While creating the metadat.xml file you need to take care of two things:
    1) Add a new category name so that you can easily find them.
    2) You need to verify that Type value is set "Style  as mentioned :  <type value="style" />
    Hope this helps you.

  • Photoshop CS2 Layer Styles / Blending Options stopped working

    I'm running Photoshop CS2 on PC. When right clicking on layers to bring up the Layer Styles / Blending Options palette, I can get the palette okay but the selections won't work when I check the boxes.
    I try to select different options....drop shadow, inner shadow, etc. but nothing shows up. It's not a preview problem because the changes are not visible in my image even after I select OK.
    I've reset my preferences (alt+ctl+shift) but it didn't help.
    Can anyone suggest to me what I can do to wake up this palette?? I've got work pending and my online searches have left me empty handed.
    Thanks in advance for any suggestions!
    Lisa

    Thank you both for your responses.
    John: The file is PSD, RGB mode, 300dpi. Last night, I tried the layer styles in another file and it wouldn't' work.... another NEW file. Today, I opened an existing file that had layers styles already in effect and I can see them, I can click them on/off AND I can put layer styles onto other layers in the existing files that did not have them previously. I just tried creating a new file and, of course, the layer styles now work in the NEW file.... this is something I tried last night and it didn't work at that time.
    Ed: Yes, I'm on the right layer. I've tried it on several layers, none of which are transparent. Thanks for the heads up.
    So, this tells me it's something to do with this particular image file. I must've accidentally hit something that's put it into a strange mode. Last night, out of frustration, I just gave up, shut it all down, and turned the computer off. This morning, I went in and created a new image document and then one by one I copied and pasted the layers of my malfunctioning image into the new one. Now I can get the layers to work.
    I have no idea what was wrong, but it seems I should just trash the problematic file and start fresh. At least the individual layers were not compressed and it's still salvagable.
    Thank you both for your time and consideration!
    Lisa

  • Need help saving layer styles Photoshop CS6 Extended for Mac (Mountain Lion)

    I have been trying to learn Photoshop. I am using Photoshop CS6 Extended on a Macbook Pro (Mountain Lion). My Adobe software has been updated. I have been doing tutorials using a lot of layer styles. In one of these tutorials, it was suggested that if I would possibly want to use the style again that I should save it. At this point I had entered all my layer styles info and was still in the window with the list of layer styles on the left (bevel and emboss, drop shadow, etc., and the "New Style" button on the right. I clicked on the "New Style" button and when another window popped up asking me to name the style, I named it. When I looked at my styles in the styles panel, I saw the little button for the new style. I saved my graphic and closed it. Later I wanted to apply this style to text in another graphic. The style was used on text originally. When I clicked on it though the style didn't look the same. Upon investigation, a couple of setting under Bevel and Emboss had reverted to defaults. They were different numbers when I saved the style. I could go back in and change these two numbers and get the same results, but I don't understand why these numbers changed on their own -- why the style didn't completely "save." Is there something I have done wrong, or is this some kind of bug? Any help would be greatly appreciated! Thank you in advance!

    Thank you very much for your reply! Yes, both documents were at 72 resolution. This morning I tried to save yet another style (same resolution document). It worked when I used it the first time. Then I switched to the other style I had saved. That one took some of the bevel and emboss settings from this morning's style. The numbers which will not save are the angle and altitude under the shading section. Just now I made another document (text at 72 resolution) and both styles had changed these numbers to 120 and 30. Is this something I am doing wrong? I am trying to use text of a similar font and size. I updated my software last night in the hopes that that would help. This morning I reset preferences. Don't know what to do! Thanks for helping me!

  • Layer Styles don't work with one file

    I'm using CS2 for Win. I've got an important file that will not accept layer styles. The layers appear to be "styled" on the layer stack, but nothing previews or shows up on the actual layer. I've created new layers; they don't take styles either. Other files in the system - including new ones - work okay; it's just this one that has the problem.
    It could be contaminated; I accidentally saved it as a PDF with layers, and then back to a TIF. It's an 8-bit file; I've tried saving it as a PSD. Same problem.
    Is there a way to rescue this thing? I have to get it to a client tomorrow. Many thanks to anyone who can help!

    I've been having this happen in Photoshop Elements 2.0.  Looks like a bug.  But it might be me not knowing what I'm doing.
    However, one fix that just worked for me was to use Image -> Duplicate Image.  Drop shadow worked in the duplicated image even though it would not work in the orginal.  Nothing I've tried doing to the orginal (save and open again, turn layers on and off, chagne order, duplicate layers and delete the "broken" ones, etc) seemed to allow the layer effectrs to work for me once it stopped working.
    This "bug" happened to me after messing around with the background layer - deleting and recreating it as a solid color.  Looks like the software is getting confused about where to image the drop shadow.  Maybe it is getting confused about the order of the layers or something?  If you turn the preview OFF you can see small changes as you adjust the paramaters in the effect.
    Curt Welch
    [email protected]

  • MY LAYER STYLES AND PHOTO EFFECTS ARE NOT SHOWING UP WHE I CLICK THE BOX, NO DROP SHADOW, ETC

    MY LAYER STYLES AND PHOTO EFFECTS ARE NOT SHOWING UP WHE I CLICK THE BOX, NO DROP SHADOW, ETC,
    I ALSO GET AN ERROR WHEN I OPEN THE EDITOR ONTITLECREATEWITHPARONS COULD NOT BE LOCATED IN THE DYNAMIC LINK ONCORE2DLL

    Seems like the database has been accidently deleted. Browse here on how to get it back http://forums.adobe.com/thread/759100

  • Layer Styles Not Saving for Use on Other Computers

    I've been trying over and over for the last 6 hours to get the layer styles I save in my custom pallet to work on other computers. I mean, I have a bunch of pallets from other sources and somehow they achieved a way of being able to save theirs, now why can't I do it on mine?
    So, here's the story of what I've done. I have a Text layer, I've added a list of FX to it via the Layer Styles menu. Now I save the document. I open up a new document and copy/paste the FX onto a new Text layer in another document window. It works great.
    Then, I save the layer styles for use later, but no. When I do everything exactly the same way, my Layer Style that I saved has lost all it coordinates of shadows and stroke widths, bevels, you name it, it's screwed up. Now I've tried this so far on CS4 and CS5, 3 different computers. All 3 computers have different settings for how Photoshop is set up, so I know it's NOT my settings alone. Though, it keeps the colors and custom gradients how they are, everything is bonkers.
    I'm ready to stop trusting in Photoshop to be there for me when I need it...or punch a hole in the wall. Whichever comes first.
    I need help for this as soon as possible, for I have an assignment I need this for.
    Running: Windows 7 64
    Adobe Photoshop CS4 & CS5.

    SplendidAngst wrote:
    <snip>
    Then, I save the layer styles for use later, but no. When I do everything exactly the same way, my Layer Style that I saved has lost all it coordinates of shadows and stroke widths, bevels, you name it, it's screwed up.<snip>
    Adobe Photoshop CS4 & CS5.
    Seems to me you left out the most critical piece of information, that is, HOW did you save the layer style for later use ?
    You might read this tutorial to see if you did it correctly.
    Paulo

  • Layer Styles in PSE6

    Hello,
    I am using PSE6. When I add new layer styles to the Styes folder they do not show up in the pallette with the originals. They do show up with the Shapes tool, however. Is there any way I can get them to show up in the Pallette?
    Thank you, Kathy

    Thanks Barbara,
    I finally figured it out! I appreciate your help. Kathy J

  • Is there a way to organize Layer styles in PSE 9 for mac?

    Hi, I'm a digital scrapbooker.  I just installed some new layer styles. They loaded successfully, but they are awfully difficult to find among all of the default layer styles (and there's no way to search for them in the drop down box).  Is it possible to create a category for them in the dropdown box so they're easier to find?
    Thanks!

    You'll get better answers on that in the proper PSE forum.
    Mylenium

  • Installing new layer styles in PSE8

    Hi
    I am trying to install new layer styles in PSE8 using Vista. I  can get them to appear in the "All" section but I am trying to get them  to appear in the dropdown list with no success.
    I have created an  xml file with the same name as the .asl file and this contains the  following:
    <?xml version="1.0" encoding="UTF-8"?>
    <PSEContent  xmlns="http://ns.adobe.com/PSEContent/2.0/">
        <subscription  value="free" />
        <type value="style" />
         <category value="$$$/content/category/type/metalstyles=metal styles"  />
    </PSEContent>
    File names = metal styles.asl  and metal styles.xml
    I have rebuilt the following 2 files
    C:\ProgramData\Adobe\Photoshop  Elements\8.0\ThumbDatabase.db3
    C:\ProgramData\Adobe\Photoshop  Elements\8.0\Locale\en_us\MediaDatabase.db3
    Could someone tell me  what I'm doing wrong
    Thanks

    A program-installer has come to my attention:
    http://www.graficalicus.com/graffishop/index.php?main_page=product_info&products_id=37&zen id=ba0034657f73d7300ab449e312ba5463
    Does this work? It may be just the thing for those of us not familiar with the manual process for installation.

  • Layer Styles and using Delete Key PSE4

    Hello,
    Slowly getting getting to know PSE4, will take more time. Finding lots of tips here in this forum and other similiar forums and sites.
    Have two quick Questions:
    1. It was mentioned "Jodi's Spedia Layer Styles". Is this a tutorial or actual styles? More info on this would be appreciated.
    2. When doing the last stage of a vignette, I had to use the backspace or delete key. I found this out by reading in this forum. Where is that documented in the Help? Is the backspace/delete key the only way, or is there a menu/mouse click also?
    Using XP Pro SP2
    TonyC

    Hi and thanks everyone for the replies. I will have to take another look in the Help Section, I looked everywhere and could not find that shortcut listed. Maybe I was looking for Backspace, and should be looking for Delete.
    I will be contacting Jodi shortly via email.
    Am confused about the "Adobe Photoshop Elements One-Click Wow by Jack Davis, ISBN 0-321-30468-3." Is this a book? Doing a web search all I can find is a book. Can someone send me a good link for more info on this. If actual styles and layers, will it work in PSE4?
    Something else: Please don't take this the wrong way, but I like to know is the subscription worth getting? I'm 50/50 on getting it or not.
    Thanks again!
    Tony

Maybe you are looking for

  • Purchase order - print preview problem

    Hi friends, i have created  a Purchase Order, when im trying to view the print preview, im getting the message ' <b>Specify address number or Address handle'</b> . Please specify where i have to give these details in PO. Regards kumar.

  • Syncing an Ipod to a New Itunes

    Hi. I recently got a macbook pro and I was able to transfer my itunes library from my PC using home share. After I bought some songs and tried to sync them on the ipod from my Mac I am getting a message to erase this ipod and sync with the new itunes

  • Sync from ipod to i tunes

    the main sync order to sync itunes with the ipod, is there a reverse way? i have more music in my ipod and i want to download it to my library

  • Can someone clear this up for me.

    I have been hearing around the forums that on the package 40/10 if you didnt recieve 37.5 or above download upgrading to the new 80/20 package is pointless ?

  • Zfd4.01 remote control via desktop4.exe. What rights are needed?(repost, seems to have been stuck in wrong thread)

    Hi. Trying to give some non-admin users the right to remote control workstations via the user object. I have followed the tids/documentation for this when using ConsoleOne and that works just fine. When trying to remote control a user object with des