Mobile app version of vmapp.org
Login or Join
Karen819

: Toggle Illustrator Layer visibility? I am looking for a way, preferably one that can be triggered via keyboard shortcut, to both toggle the current layer to visible/hidden and to be able to

@Karen819

Posted in: #AdobeIllustrator #IllustratorScripting #Layers

I am looking for a way, preferably one that can be triggered via keyboard shortcut, to both toggle the current layer to visible/hidden and to be able to toggle a specifically-named layer visible/hidden.

What I am aiming for with the specifically-named layer visibility toggle is to turn the template layer visible/hidden.

It would be great to be able to toggle without selecting the layer, but I'd take that option if that were all there was. Both would be ideal.

This Adobe forum post seemed to be the solution via scripting, until I realized it was for Photoshop, not Illustrator (handy nonetheless).

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Karen819

1 Comments

Sorted by latest first Latest Oldest Best

 

@Cugini998

No problemo.
#target illustrator

layer = app.activeDocument.layers.getByName("Toggle")
layer.visible = ! layer.visible


Put this in a action and bind action to shortcut. NOTE: Adobe has no quality control for their scripting environment so the actions pallete will forget the script each time you start Illustrator so to get this
working reload the default actions again and it works. Simply put actions palette is just initialized too early.

Update The load problem is now fixed after 10 years of waiting

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme