• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit Search
0

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

Adobe Employee ,
Aug 03, 2022 Aug 03, 2022

Copy link to clipboard

Copied

Daksri_0-1659533463689.png

 

TOPICS
Scripting

Views

80

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

correct answers 1 Correct answer

Community Expert , Aug 03, 2022 Aug 03, 2022

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.');
}

 

Votes

Translate

Translate
Community Expert ,
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

Votes

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 Employee ,
Aug 03, 2022 Aug 03, 2022

Copy link to clipboard

Copied

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

Votes

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
Community Expert ,
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

Votes

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é

Votes

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