Skip to main content
Inspiring
November 16, 2024
Question

Is the active layer the selected layer in the layers palette or not necessarily?

  • November 16, 2024
  • 1 reply
  • 283 views

In extend script, is the active layer the selected layer in the layers palette or not necessarily?

In the document there was an active layer on the reference newLayer (with name Layer 1 copy).
Then a temp layer was created on top. After working with the temp layer, it is shown in the layers palette as highlighted in blue - it is the active layer. 

Now we need to activate the previous layer newLayer again. To do this, I lock and hide the temp layer, and do: doc.activeLayer = newLayer;

But even with the subsequent app.redraw();, the layer palette looks like newLayer is an inactive layer.

 

This topic has been closed for replies.

1 reply

Sergey Osokin
Inspiring
November 16, 2024

I have no problem in the panel with highlighting returning to layer doc.activeLayer = newLayer. What is your operating system and version of Illustrator? Or maybe show more of a piece of script code.

Inspiring
November 16, 2024

This is likely another of countless other bugs. Instead of activating the newLayer ref I've done newLayer.pageItems.length; and it gave me a correct value.