Cannot hide selected object with JS code in my Plugin

Hi guys, I am porting my plugin from Sketch 66 to latest Sketch, Version 2025.1.3 (203472).

I am facing an issue this this line of code:

layer.setIsVisible(false);

no effect at all.

But if I hide layer with Command+Shift+h and then call layer.setIsVisible(true); in my plugin the layer gets visible.

Please help. :exploding_head:

I’m not a big expert on this but I believe this’ll work.

layer.hidden = true;
1 Like

Thank you! It works!

Now I see it:

//  to hide you do
layer.hidden = true;

// to show you do
layer.setIsVisible(false);

Technologia!! :laughing:

1 Like

giphy

1 Like