I am trying to get the PresetKind to establish if an adjustment layer specifically curves have no adjustments applied to them. I made the following getter but it doesn’t want to work for me. Any help on where the bug might be would be much appreciated
const app = require("photoshop").app;
const batchPlay = require("photoshop").action.batchPlay;
Object.defineProperty(require("photoshop").app.Layer.prototype,
"presetKindType",
{
get: () =>{
const result = batchPlay(
[
{
_obj: "get",
_target: [
{
_property: "presetKindType"
},
{
_ref: "adjustmentLayer",
_enum: "ordinal",
_value: "targetEnum"
}
],
_options: {
dialogOptions: "dontDisplay"
}
}
],{
synchronousExecution: true,
modalBehavior: "fail"
});
return result[0].presetKindType._value;
}
})