Adjustment Layer Getting Preset Kind

I believe this might be related to my other question here. At first glance it looks like it might also be a bit too advanced for me, but will need to play with these flags

Looks very powerful, but not completely sure how to implement it. Would you have a simple example?

apologies, just realised you mean the example is in alchemist by using the generator setting. Many Thanks

This works, would like to drill down for specific properties like the documentation…

const batchPlay = require("photoshop").action.batchPlay;

const result = await batchPlay(
[
   {
      _obj: "get",
      _target: [
         {
            _property: "json"
         },
         {
            _ref: "document",
            _id: 219
         }
      ],
      layerInfo: true,
      includeAncestors: true,
      _options: {
         dialogOptions: "dontDisplay"
      }
   }
],{
   synchronousExecution: false,
   modalBehavior: "fail"
});
const pinned = result[0].json.layers[0].type;


{"version":"1.6.1","timeStamp":0.000,"count":0,"id":219,"layers":[{"id":9,"index":13,"type":"layerSection","name":"BACKGROUND","bounds":{"top":0,"left":0,"bottom":0,"right":0},"visible":true,"clipped":false,"blendOptions":{"mode":"passThrough"},"generatorSettings":false,"id":9,"index":13,"layers":[{"id":14,"index":12,"type":"adjustmentLayer","name":"CV CC","bounds":{"top":0,"left":0,"bottom":5956,"right":3978},"visible":true,"clipped":false,"adjustment":{"presetKind":"presetKindUserDefined","class":"curves"},"generatorSettings":false},{"id":13,"index":11,"type":"adjustmentLayer","name":"CV H","bounds":{"top":0,"left":0,"bottom":5956,"right":3978},"visible":true,"clipped":false,"adjustment":{"presetKind":"presetKindUserDefined","using":"","class":"curves"},"generatorSettings":false},{"id":12,"index":10,"type":"adjustmentLayer","name":"CV SHDW","bounds":{"top":0,"left":0,"bottom":5956,"right":3978},"visible":true,"clipped":false,"adjustment":{"presetKind":"presetKindUserDefined","using":"","class":"curves"},"generatorSettings":false},{"id":11,"index":9,"type":"adjustmentLayer","name":"CV MID","bounds":{"top":0,"left":0,"bottom":5956,"right":3978},"visible":true,"clipped":false,"adjustment":{"presetKind":"presetKindUserDefined","using":"","class":"curves"},"generatorSettings":false}]},{"id":3,"index":7,"type":"layerSection","name":"PRODUCT","bounds":{"top":0,"left":0,"bottom":0,"right":0},"visible":true,"clipped":false,"blendOptions":{"mode":"passThrough"},"generatorSettings":false,"id":3,"index":7,"layers":[{"id":8,"index":6,"type":"adjustmentLayer","name":"CV CC","bounds":{"top":0,"left":0,"bottom":5956,"right":3978},"visible":true,"clipped":false,"adjustment":{"presetKind":"presetKindUserDefined","class":"curves"},"generatorSettings":false},{"id":7,"index":5,"type":"adjustmentLayer","name":"CV H","bounds":{"top":0,"left":0,"bottom":5956,"right":3978},"visible":true,"clipped":false,"adjustment":{"presetKind":"presetKindUserDefined","using":"","class":"curves"},"generatorSettings":false},{"id":6,"index":4,"type":"adjustmentLayer","name":"CV SHDW","bounds":{"top":0,"left":0,"bottom":5956,"right":3978},"visible":true,"clipped":false,"adjustment":{"presetKind":"presetKindUserDefined","using":"","class":"curves"},"generatorSettings":false},{"id":5,"index":3,"type":"adjustmentLayer","name":"CV MID","bounds":{"top":0,"left":0,"bottom":5956,"right":3978},"visible":true,"clipped":false,"adjustment":{"presetKind":"presetKindUserDefined","using":"","class":"curves"},"generatorSettings":false}]},{"id":2,"index":1,"type":"layer","name":"Retouch","protection":{"position":true},"bounds":{"top":0,"left":0,"bottom":0,"right":0},"visible":true,"clipped":false,"pixels":true,"generatorSettings":false},{"id":1,"index":0,"type":"backgroundLayer","name":"Background","protection":{"transparency":true,"position":true,"artboardAutonest":true},"bounds":{"top":0,"left":0,"bottom":5956,"right":3978},"visible":true,"clipped":false,"pixels":true,"generatorSettings":false}]}```

Was thinking it could be something like this…

const batchPlay = require("photoshop").action.batchPlay;

const result = await batchPlay(
[
   {
      _obj: "get",
      _target: [
         {
            _property: "json"
         },
         {
            _ref: "document",
            _id: 219
         }
      ],
      layerInfo: {
            type: true

      },
      includeAncestors: true,
      _options: {
         dialogOptions: "dontDisplay"
      }
   }
],{
   synchronousExecution: false,
   modalBehavior: "fail"
});

but it doesn’t work

There are even flags to get info only for layers that you are interested in.

looks like I’m going to have to do a bit of experimenting, many thanks for the tip not to mention Alchemist its a fantastic tool

any pointers on how to get whichInfo working with layers. Cant for the life of me get it to work…

bounds is returning a result, but not layer names… any help on syntax would be amazing

`const batchPlay = require(“photoshop”).action.batchPlay;

const result = await batchPlay(
[
{
_obj: “get”,
_target: [
{
_property: “json”
},

     {
        "_ref": "document",
        "_enum": "ordinal",
        "_value": "targetEnum"
    }
  
  ],
  whichInfo: {
      bounds: true, 
    layers:{name:true

      }
  

  },
  includeAncestors: true,
  _options: {
     dialogOptions: "dontDisplay"
  }

}
],{
synchronousExecution: false,
modalBehavior: “fail”
});`