-
Notifications
You must be signed in to change notification settings - Fork 0
/
OrganizeFolders.jsx
44 lines (36 loc) · 1.08 KB
/
OrganizeFolders.jsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<javascriptresource>
<name>Organize Folders</name>
<about>
This will color code nested folders to help readiblity.
It will also rename layers.
- Evan Viera
</about>
<menu>filter</menu>
<category>Viera</category>
<type>automate</type>
<enableinfo>true</enableinfo>
</javascriptresource>
#include "vieraLibrary.jsx"
var doc = activeDocument;
var idColors = [ "Rd ", "Orng", "Ylw ", "Grn ", "Bl ", "Vlt ", "Gry " ];
var lastColor = 0;
colorGroupTags( doc );
// ****************************************
// Collects all layers underneat into array
// ****************************************
function colorGroupTags( __parent )
{
for ( var i = 0; i < __parent.layers.length; i++ )
{
var currentLayer = __parent.layers[ i ];
var visible = currentLayer.visible;
if ( currentLayer.typename != "ArtLayer" )
{
doc.activeLayer = currentLayer;
setLabelColor( idColors[ lastColor ] );
lastColor = (lastColor + 1) % idColors.length;
colorGroupTags( currentLayer );
}
currentLayer.visible = visible;
}
}