Yes, so that’s what I did as you suggest in the first option, to get document json
, but then I need to parse all layers tree.
The second option to get by layer ID directly - I tried, and as I mentioned, it doesn’t really work. Responses don’t make much sense to me if I’m honest. For example this:
This is the response, for the top layer Gradient Fill 2 copy 4
(contains first group ColorrWheel copy
and second group with selected sub-layer):
{
"version": "1.6.1",
"timeStamp": 0,
"count": 0,
"id": 59,
"file": "U:\\Creative Cloud Files\\_Stuff\\ColorWheel.psd",
"bounds": {
"top": 0,
"left": 0,
"bottom": 1400,
"right": 1168
},
"selection": [
7
],
"resolution": 72,
"globalLight": {
"angle": 90,
"altitude": 30
},
"generatorSettings": false,
"profile": "Untagged RGB",
"mode": "RGBColor",
"depth": 8,
"layers": [
{
"id": 29,
"index": 20,
"type": "layerSection",
"name": "ColorrWheel copy",
"bounds": {
"top": 0,
"left": -2,
"bottom": 1400,
"right": 1170
},
"boundsWithFX": {
"top": 0,
"left": -2,
"bottom": 1400,
"right": 1170
},
"visible": false,
"clipped": false,
"blendOptions": {
"mode": "passThrough"
},
"generatorSettings": false
},
{
"id": 16,
"index": 9,
"type": "layerSection",
"name": "ColorrWheel",
"bounds": {
"top": 0,
"left": -2,
"bottom": 1400,
"right": 1170
},
"boundsWithFX": {
"top": 0,
"left": -2,
"bottom": 1400,
"right": 1170
},
"visible": true,
"clipped": false,
"blendOptions": {
"mode": "passThrough"
},
"generatorSettings": false,
"layers": [
{
"id": 14,
"index": 7,
"type": "adjustmentLayer",
"name": "Gradient Fill 2 copy 4",
"bounds": {
"top": 1250,
"left": 0,
"bottom": 1300,
"right": 1170
},
"boundsWithFX": {
"top": 1250,
"left": 0,
"bottom": 1300,
"right": 1170
},
"visible": true,
"clipped": false,
"fill": {
"dither": false,
"reverse": true,
"gradientsInterpolationMethod": "smooth",
"gradientAspectRatio": 1,
"angle": {
"value": 0,
"units": "angleUnit"
},
"type": "linear",
"align": true,
"scale": {
"value": 99.9997,
"units": "percentUnit"
},
"offset": {
"horizontal": {
"value": 0,
"units": "percentUnit"
},
"vertical": {
"value": 0,
"units": "percentUnit"
}
},
"gradient": {
"name": "Custom",
"gradientForm": "customStops",
"interfaceIconFrameDimmed": 4096,
"colors": [
{
"color": {
"red": 0,
"green": 0,
"blue": 255
},
"type": "userStop",
"location": 0,
"midpoint": 50
},
{
"color": {
"red": 255,
"green": 255,
"blue": 0
},
"type": "userStop",
"location": 4096,
"midpoint": 50
}
],
"transparency": [
{
"opacity": {
"value": 100,
"units": "percentUnit"
},
"location": 0,
"midpoint": 50
},
{
"opacity": {
"value": 100,
"units": "percentUnit"
},
"location": 4096,
"midpoint": 50
}
]
},
"class": "gradientLayer"
},
"mask": {
"bounds": {
"top": 1250,
"left": 0,
"bottom": 1300,
"right": 1170
}
},
"generatorSettings": false
}
]
}
]
}
This is the response, for the layer Gradient Fill 4
(contains all three top-level layers/groups):
{
"version": "1.6.1",
"timeStamp": 0,
"count": 0,
"id": 59,
"file": "U:\\Creative Cloud Files\\_Stuff\\ColorWheel.psd",
"bounds": {
"top": 0,
"left": 0,
"bottom": 1400,
"right": 1168
},
"selection": [
10
],
"resolution": 72,
"globalLight": {
"angle": 90,
"altitude": 30
},
"generatorSettings": false,
"profile": "Untagged RGB",
"mode": "RGBColor",
"depth": 8,
"layers": [
{
"id": 29,
"index": 20,
"type": "layerSection",
"name": "ColorrWheel copy",
"bounds": {
"top": 0,
"left": -2,
"bottom": 1400,
"right": 1170
},
"boundsWithFX": {
"top": 0,
"left": -2,
"bottom": 1400,
"right": 1170
},
"visible": false,
"clipped": false,
"blendOptions": {
"mode": "passThrough"
},
"generatorSettings": false
},
{
"id": 19,
"index": 10,
"type": "adjustmentLayer",
"name": "Gradient Fill 4",
"bounds": {
"top": 0,
"left": 0,
"bottom": 1400,
"right": 1168
},
"boundsWithFX": {
"top": 0,
"left": 0,
"bottom": 1400,
"right": 1168
},
"visible": true,
"clipped": false,
"blendOptions": {
"blendRange": [
{
"channel": "gray",
"srcBlackMin": 43,
"srcBlackMax": 62,
"srcWhiteMin": 167,
"srcWhiteMax": 190,
"destBlackMin": 0,
"destBlackMax": 0,
"destWhiteMin": 255,
"desaturate": 255
}
]
},
"fill": {
"dither": false,
"reverse": false,
"gradientsInterpolationMethod": "smooth",
"gradientAspectRatio": 1,
"angle": {
"value": 90,
"units": "angleUnit"
},
"type": "linear",
"align": true,
"scale": {
"value": 100,
"units": "percentUnit"
},
"offset": {
"horizontal": {
"value": 0,
"units": "percentUnit"
},
"vertical": {
"value": 0,
"units": "percentUnit"
}
},
"gradient": {
"name": "Black, White",
"gradientForm": "customStops",
"interfaceIconFrameDimmed": 4096,
"colors": [
{
"color": {
"redFloat": -0.0000016205,
"greenFloat": 5.59524e-7,
"blueFloat": -6.69675e-7
},
"type": "userStop",
"location": 0,
"midpoint": 50
},
{
"color": {
"redFloat": 1,
"greenFloat": 0.999999,
"blueFloat": 1
},
"type": "userStop",
"location": 4096,
"midpoint": 50
}
],
"transparency": [
{
"opacity": {
"value": 100,
"units": "percentUnit"
},
"location": 0,
"midpoint": 50
},
{
"opacity": {
"value": 100,
"units": "percentUnit"
},
"location": 4096,
"midpoint": 50
}
]
},
"class": "gradientLayer"
},
"mask": {
"bounds": {
"top": 0,
"left": 0,
"bottom": 1400,
"right": 1168
},
"extendWithWhite": true
},
"generatorSettings": false
},
{
"id": 16,
"index": 9,
"type": "layerSection",
"name": "ColorrWheel",
"bounds": {
"top": 0,
"left": -2,
"bottom": 1400,
"right": 1170
},
"boundsWithFX": {
"top": 0,
"left": -2,
"bottom": 1400,
"right": 1170
},
"visible": true,
"clipped": false,
"blendOptions": {
"mode": "passThrough"
},
"generatorSettings": false
}
]
}
And this is the response, for the second group ColorrWheel
(contains both groups):
{
"version": "1.6.1",
"timeStamp": 0,
"count": 0,
"id": 59,
"file": "U:\\Creative Cloud Files\\_Stuff\\ColorWheel.psd",
"bounds": {
"top": 0,
"left": 0,
"bottom": 1400,
"right": 1168
},
"selection": [
9
],
"resolution": 72,
"globalLight": {
"angle": 90,
"altitude": 30
},
"generatorSettings": false,
"profile": "Untagged RGB",
"mode": "RGBColor",
"depth": 8,
"layers": [
{
"id": 29,
"index": 20,
"type": "layerSection",
"name": "ColorrWheel copy",
"bounds": {
"top": 0,
"left": -2,
"bottom": 1400,
"right": 1170
},
"boundsWithFX": {
"top": 0,
"left": -2,
"bottom": 1400,
"right": 1170
},
"visible": false,
"clipped": false,
"blendOptions": {
"mode": "passThrough"
},
"generatorSettings": false
},
{
"id": 16,
"index": 9,
"type": "layerSection",
"name": "ColorrWheel",
"bounds": {
"top": 0,
"left": -2,
"bottom": 1400,
"right": 1170
},
"boundsWithFX": {
"top": 0,
"left": -2,
"bottom": 1400,
"right": 1170
},
"visible": true,
"clipped": false,
"blendOptions": {
"mode": "passThrough"
},
"generatorSettings": false
}
]
}