In Adobe Illustrator, clicking on a layer’s name in the Layers panel does not select the layer. Rather, it activates the layer, making it the active layer, but does not select any objects within the layer.
The “selectLayers.jsx” script provides an alternative way to select layers using a custom user interface.
The script creates a palette window with a list of all the layers in the active document. The user can select one or multiple layers from the list using different methods. They can select a single layer by clicking on it or double-clicking it. They can also select multiple contiguous layers by clicking on the first layer, holding Shift, and clicking on the last one. Finally, they can select multiple non-contiguous layers by clicking on them while holding Ctrl/CMD.