# Adjustment Layer Getting Preset Kind

**URL:** <https://forums.creativeclouddeveloper.com/t/adjustment-layer-getting-preset-kind/4590>\
**Category:** Photoshop\
**Tags:** javascript\
**Created:** [April 28, 2022, 8:26am UTC](https://forums.creativeclouddeveloper.com/t/adjustment-layer-getting-preset-kind/4590 "2022-04-28T08:26:47Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![Karmalakas](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/karmalakas/32/1048_2.png) [@Karmalakas](https://forums.creativeclouddeveloper.com/u/Karmalakas)\
**Post date:** [April 28, 2022, 10:55am UTC](https://forums.creativeclouddeveloper.com/t/adjustment-layer-getting-preset-kind/4590/9 "2022-04-28T10:55:38Z")

</div>

Not sure if it’s the only way, but you can get this from layers `json` property.

```auto
    {
        _obj: "get",
        _target: [
            {_property: "json"},
            { _ref: "layer",_enum: "ordinal", _value: "targetEnum"},
        ],
        _options: {dialogOptions: "dontDisplay"}
    }

```

There you’ll need to `JSON.parse(propertyValue)` and you’ll find `layers`. Then you could recursively iterate through these layers and find the one you need by ID. You’ll get something like that:

```auto
        {
          "id": 18,
          "index": 4,
          "type": "adjustmentLayer",
          "name": "Curves 1",
          "bounds": {"top": 0, "left": 0, "bottom": 2048, "right": 3072},
          "visible": true,
          "clipped": false,
          "adjustment": {
            "presetKind": "presetKindCustom",
            "adjustment": [
              {
                "channel": "composite",
                "curve": [
                  {"horizontal": 0, "vertical": 0},
                  {"horizontal": 147, "vertical": 106},
                  {"horizontal": 219, "vertical": 136},
                  {"horizontal": 255, "vertical": 255}
                ]
              }
            ],
            "class": "curves"
          },
          "mask": {
            "bounds": {"top": 0, "left": 0, "bottom": 2048, "right": 3072},
            "extendWithWhite": true
          },
          "generatorSettings": false
        }

```

Just checked and even if you reset all points on the curve, it still gives `custom`, but without `adjustment`:

```auto
        {
          "id": 18,
          "index": 4,
          "type": "adjustmentLayer",
          "name": "Curves 1",
          "bounds": {"top": 0, "left": 0, "bottom": 2048, "right": 3072},
          "visible": true,
          "clipped": false,
          "adjustment": {
            "presetKind": "presetKindCustom",
            "class": "curves"
          },
          "mask": {
            "bounds": {"top": 0, "left": 0, "bottom": 2048, "right": 3072},
            "extendWithWhite": true
          },
          "generatorSettings": false
        }

```

Freshly created layer has exact same structure, but `"presetKind": "presetKindDefault"`

---

_[View the full topic](https://forums.creativeclouddeveloper.com/t/adjustment-layer-getting-preset-kind/4590)._
