How to validate if that particular has these many images and groups?

Explorer ,
Aug 03, 2022 Aug 03, 2022

Copy link to clipboard

Copied

Daksri_0-1659533463689.png

 

TOPICS
Scripting

Views

41

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Aug 03, 2022 Aug 03, 2022

Copy link to clipboard

Copied

Hi,

You want to get the number of groups and images in Layer 3 or all layers?

 

Best regards

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Aug 03, 2022 Aug 03, 2022

Copy link to clipboard

Copied

I have to validate that there are various layers containing the objects .

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Aug 03, 2022 Aug 03, 2022

Copy link to clipboard

Copied

Try the following  code

var _layers = app.activeDocument.layers;
for (var l = 0; l<_layers.length; l++) {
    var _images = _layers[l].rasterItems;
    var _groups = _layers[l].groupItems;
    alert(_layers[l].name + ' ---> ' + _images.length + ' images and ' + _groups.length + ' groups.');
}

 

Best regards

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Aug 03, 2022 Aug 03, 2022

Copy link to clipboard

Copied

LATEST

Hi!

alert( app.activeDocument.layers["Layer 3"].pageItems[0].typename);

Il existe une documentation que vous devriez consulter.

René

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines