Skip to main content
Inspiring
January 17, 2022
Answered

Script, count only the text items in a group

  • January 17, 2022
  • 2 replies
  • 461 views

H!

I have a layer group with text layers and non text layers

How i can count the text layers only?

This topic has been closed for replies.
Correct answer Kukurykus

Originally in Script, copying text layers contents to clipboard I wanted to filter text layers::

 

tLs = [].slice.call(activeDocument.activeLayer.artLayers), nmbr = 0
while(tLs.length) nmbr += tLs.shift().kind == LayerKind.TEXT

 

2 replies

Kukurykus
KukurykusCorrect answer
Legend
January 17, 2022

Originally in Script, copying text layers contents to clipboard I wanted to filter text layers::

 

tLs = [].slice.call(activeDocument.activeLayer.artLayers), nmbr = 0
while(tLs.length) nmbr += tLs.shift().kind == LayerKind.TEXT

 

lambiloon
Community Expert
Community Expert
January 17, 2022

Hi try folowing option...regards

 

Ali Sajjad / Graphic Design Trainer / Freelancer / Adobe Certified Professional
siomospAuthor
Inspiring
January 17, 2022

Hi, thank you for the reply!
I am looking for getting the number as variable in a script

c.pfaffenbichler
Community Expert
Community Expert
January 17, 2022

Can there be Layer Groups in the Group/s?