5

Is it possible to toggle the locked/unlocked state of the current layer via keyboard shortcut? I'd love to be able to toggle show/hide for layers as well.

  • I don't think so. And it's not in the keyboard shortcuts. So, I think you'd need scripting. – Scott Dec 9 '14 at 21:34
4

here's a one-liner script that toggles active layer visibility

app.activeDocument.activeLayer.visible ^= 1;

this other one-liner toggles lock/unlock

app.activeDocument.activeLayer.locked ^= 1;

install those 2 scripts into your default scripts folder, then create two actions to run them, assign them shortcut keys and you're all set.

  • Those scripts worked perfectly, but I was not able to create an action that used them. And in the past, Actions which used scripts in Illustrator were not retained after quitting and relaunching. I am using CS6, what version are you on? Thanks. – George C Dec 11 '14 at 2:26
  • Hi George, you have to use "Insert Menu Item..." in the Action's panel flyout menu to be able to record scripts. – Carlos Canto Dec 11 '14 at 7:57
  • ...correct, Actions don't survive a restart, that's a decades long bug Adobe doesn't want to address or is unable to fix, either option is bad for the "leading" design software company...the workaround is to Save your actions and reload them after relaunching, far from perfect flow, but better than re-recording. – Carlos Canto Dec 11 '14 at 8:10
  • I forgot about "Insert menu item", thanks. Good to know on reloading actions, I didn't know that was a workaround. Too bad I can't set up reloading Actions as an Action! But agreed, that is an easier method than recreating. Thank you. – George C Dec 12 '14 at 16:47
-2

Its Command+2 to lock, Command+Alt+2 to unlock

  • Those commands only work for objects, not for layers. – George C Jan 10 '15 at 1:36

protected by Mᴏɴᴋᴇʏ Jun 28 '17 at 13:39

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.