Skip to main content
Participating Frequently
January 14, 2019
Answered

looking for script to 'Show All Layers"

  • January 14, 2019
  • 1 reply
  • 1566 views

Dear all,

I'm looking script to 'Show All Layers" as below.

I searched Abobe script guide but I can not figure out.

Please help to save my time in work.

This topic has been closed for replies.
Correct answer pixxxelschubser

show all layers and sublayers

adapted from a script snippet by Loic.Aigon

var aDoc = app.activeDocument;

var showLayers = function ( layers )

{

    var i = layers.length, layer;

    while ( i-- )

    {

    layer = layers;

    layer.visible = true;

    layer.layers.length && showLayers ( layer.layers );

    }

}

showLayers ( aDoc.layers );

Have fun

1 reply

pixxxelschubser
Community Expert
Community Expert
January 14, 2019

Do you mean only layers and sublayers - exactly as the menu command?

Or only top level layers?

Or all Layers including sublayers and all objects within?

Participating Frequently
January 14, 2019

What I want is 'only layers and sublayers' but 'all Layers including sublayers and all objects within' will be helpful too. Thank you.

pixxxelschubser
Community Expert
pixxxelschubserCommunity ExpertCorrect answer
Community Expert
January 15, 2019

show all layers and sublayers

adapted from a script snippet by Loic.Aigon

var aDoc = app.activeDocument;

var showLayers = function ( layers )

{

    var i = layers.length, layer;

    while ( i-- )

    {

    layer = layers;

    layer.visible = true;

    layer.layers.length && showLayers ( layer.layers );

    }

}

showLayers ( aDoc.layers );

Have fun