Last active
August 29, 2015 14:23
-
-
Save anton-liubushkin/c5d05795b2b0ed22a7a5 to your computer and use it in GitHub Desktop.
Return how many layers are there in document — Photoshop script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getLayersCount() { | |
var ref = new ActionReference(); | |
ref.putProperty (stringIDToTypeID ("property"), charIDToTypeID('NmbL')) | |
ref.putEnumerated(charIDToTypeID('Dcmn'), charIDToTypeID('Ordn'), charIDToTypeID('Trgt')); | |
var count = executeActionGet(ref).getInteger(charIDToTypeID('NmbL')); | |
return count | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment