Counting Layers In Photoshop

Have you ever wanted to know how many layers are currently in your .pdf/.psd file? Simple, the answer is 3, or 8 or even 17. I’m not talking about simple files like this one.

 

Three layered .psd in photoshop

 

Ok, so clearly you can work that one out for yourself…. theirs three layers in that file. How about this file?

 

 

So this image is a bit more of a strain to count, it would probably take five, maybe ten minutes to count the layers. Theirs only 45 layers but this can all take time if you have to count them yourself. What if your images start to get really big (not filesize) but regards layers. Do you really have the time to count hundreds of layers? Would you have the patience?

The following will help you get around this!
Photoshop Layer counting script – This script will count all the layers for you automatically!

 

So I’m sure you want to know how to use this?
It’s simple!!

  • Right-click the above link and download the script to your desktop
    (or somewhere you will remember)
  • Open up Photoshop with the file you wish to count
  • Click on ‘File’
  • Then ‘Scripts’
  • Now click ‘Browse’
  • Find the script you just downloaded to your desktop and click Load
  • You will now be prompted with ‘Go through your file and count all the layers??
  • Click ‘Yes’
  • You will now be informed of the amount of layers in your file!

Job done, that was a lot quicker than counting 20-5,000+ layers now wasn’t it?

 

I hope this script speeds up your photoshopping someday :)

 

 

This script is used at your own risk, I have personally used it many times but shall not be held responsible for any misbehaviour caused by it!

 

 

  • 6 years after you published this, it has just helped someone!

    Thanks! 😀

  • Hi people! Here’s my version of this mega-useful script :)
    var totalProgress = 0
    var laySets = 0
    function layerCounter(inObj)
    {
    laySets += inObj.layerSets.length
    totalProgress += inObj.artLayers.length
    for (var i=0; i < inObj.layerSets.length; i++) {
    totalProgress++
    layerCounter(inObj.layerSets[i])
    }
    return totalProgress – laySets
    }

    function main() {
    alert("Layer count = " + layerCounter(app.activeDocument) + "\nGroups Count = " + laySets)
    }

    main()

  • minor update. now it’s showing total and visible layers too:
    var totalLayers = 0
    var laySets = 0
    var visibleLayers = 0

    function layerCounter(inObj)
    {
    laySets += inObj.layerSets.length
    totalLayers += inObj.artLayers.length

    for (var a=0; a < inObj.artLayers.length; a++) {
    if (inObj.artLayers[a].visible) visibleLayers++
    }

    for (var i=0; i < inObj.layerSets.length; i++) {
    totalLayers++
    layerCounter(inObj.layerSets[i])
    }
    return totalLayers – laySets
    }

    function main() {
    alert("Total Layers = " + layerCounter(app.activeDocument) +
    "\nVisible Layers = " + visibleLayers +
    "\nGroups Count = " + laySets)
    }

    main()

  • Sara

    thank you! fast and easy. 6 years later, the same technique is used. 742 layers. Saved me a lot of time 😀

  • Bobby Wain

    this was a tremendous help! 780 layers total! would have hated counting that;-p

  • marko beveli

    how to find tif files which have layers and move them to subfolder?
    or how to copy all layers name and copy it to keywords metadata?

    thanks

  • Thanks. Still works on Photoshop CC 2014 (2015)

  • Sag mir, wieviel Ebenen stehen … | PhotoshopNonstop BLOG
  • Count layers in photoshop automatically | Fox Force Five

Success, your comment is awaiting moderation.