would you want to get adjustment layer property?
if so, I could get on Photoshop 24.7 through the code below
const {executeAsModal} = require("photoshop").core;
const {batchPlay} = require("photoshop").action;
async function actionCommands() {
const result = await batchPlay(
[
{
_obj: "get",
_target: [
{
_ref: "layer",
_id: 3// write layer id you want to get
},
{
_ref: "document",
_id: 59// write document id you want to get
}
],
_options: {
dialogOptions: "dontDisplay"
}
}
],
{}
);
console.log(result);
}
async function runModalFunction() {
await executeAsModal(actionCommands, {"commandName": "Action Commands"});
}
(async () => {
await runModalFunction();
})();
getting value here
/*
adjustment: Array(1)
0:
adjustment: Array(1)
0:
channel:
_enum: "channel"
_ref: "channel"
_value: "composite"
[[Prototype]]: Object
curve: Array(4)
0: {_obj: "paint", horizontal: 0, vertical: 0}
1: {_obj: "paint", horizontal: 122, vertical: 110}
2: {_obj: "paint", horizontal: 209, vertical: 209}
3: {_obj: "paint", horizontal: 255, vertical: 255}
length: 4
[[Prototype]]: Array(0)
_obj: "curvesAdjustment"
[[Prototype]]: Object
length: 1
[[Prototype]]: Array(0)
presetKind: {_enum: "presetKindType", _value: "presetKindCustom"}
_obj: "curves"
[[Prototype]]: Object
length: 1
[[Prototype]]: Array(0)
*/
but if you couldn’t see any value you want to, try the code below.
const {executeAsModal} = require("photoshop").core;
const {batchPlay} = require("photoshop").action;
async function actionCommands() {
const result = await batchPlay(
[
{
_obj: "get",
_target: [
{
_property: "json"
},
{
_ref: "layer",
_id: 3// write layer id you want to get
},
{
_ref: "document",
_id: 59// write document id you want to get
}
],
_options: {
dialogOptions: "dontDisplay"
}
}
],
{}
);
//this is JSON value. make sure parsing string value.
console.log(JSON.parse(result[0].json));
}
async function runModalFunction() {
await executeAsModal(async () => await actionCommands(), {"commandName": "Action Commands"});
}
(async ()=>{
await runModalFunction();
})();
/*
bounds: {top: 0, left: 0, bottom: 900, right: 1200}
count: 0
depth: 8
file: "unknown"
generatorSettings: false
globalLight: {angle: 90, altitude: 30}
id: 59
layers: Array(1)
0:
adjustment:
adjustment: Array(1)
0:
channel: "composite"
curve: Array(4)
0: {horizontal: 0, vertical: 0}
1: {horizontal: 122, vertical: 110}
2: {horizontal: 209, vertical: 209}
3: {horizontal: 255, vertical: 255}
length: 4
[[Prototype]]: Array(0)
[[Prototype]]: Object
length: 1
[[Prototype]]: Array(0)
class: "curves"
presetKind: "presetKindCustom"
[[Prototype]]: Object
*/
layer has more values as a JSON property which contains adjustment value.
and I found it from a past topic.