Copy link to clipboard
Copied
My question is how to validate that particular layer has Image. Like we can see , it is image as showing in Control Panel. In my code
HI,
I am not sure what excatly are you looking for. Im your screenshots there is no sublayer.
1. To get an Image
As per your screenshot, you can get an image if it is raster like below
var lar1 = app.activeDocument.layers[0];
var _image = lar1.rasterItems[0];
if it is a linked file then as
var lar1 = app.activeDocument.layers[0];
var _image = lar1.placedItems[0];
2. To check if layer has two syblayers
var lar1 = app.activeDocument.layers[0];
var _subLayers = lar1.layers;
if(_subLayers.lengt
...
Copy link to clipboard
Copied
HI,
I am not sure what excatly are you looking for. Im your screenshots there is no sublayer.
1. To get an Image
As per your screenshot, you can get an image if it is raster like below
var lar1 = app.activeDocument.layers[0];
var _image = lar1.rasterItems[0];
if it is a linked file then as
var lar1 = app.activeDocument.layers[0];
var _image = lar1.placedItems[0];
2. To check if layer has two syblayers
var lar1 = app.activeDocument.layers[0];
var _subLayers = lar1.layers;
if(_subLayers.length == 2){
alert('Two sublayers exists');
}
Copy link to clipboard
Copied
Thank you for the reply !!!