No announcement yet.

Targeted layer visibility toggle script

  • Filter
  • Time
  • Show
Clear All
new posts

  • Photoshop: Targeted layer visibility toggle script

    First post here so sorry if this isn't in the right section. I wrote a few scripts for Photoshop that make my workflow a little easier. The script will take the currently selected layer/group and make it hidden. It also marks it with a "[T]" for toggle. Like this:

    Layer1 [T]
    If I now select Layer3 I can run this script and Layer1 will now be shown. If I run the script again Layer1 hides... and so on as many times as I run the script. Layers can be named whatever you want, this is just my example.

    There's also a "LayerToggleClear" script file that when you run it, remove the [T] so you can target another layer for toggling.

    Why this is useful
    I use this for skin retouching where I'll have a layer towards the top that brings up the contrast on the reds. On my 50% gray layer where I dodge/burn I can keep working with and without the contrast just by running the script. You can toggle visibility on layers that aren't currently selected so you can keep on painting or whatever.

    That's clunky
    Yeah if you use it by doing the file>scripts>run script way. If you instead map the script to an action with a keystroke, it's very fast. Right now for me F8 runs the main toggle script and SHIFT+F8 runs the clearing script.

    It loops through all your layers that aren't in a group first, then moves on to the groups and goes top to bottom. The loop stops if a toggle is found. Layer5 will be found less quickly than Layer0 in the case below. This may be slower the more groups within groups that you have.

    Attached Files

Related Topics


  • jjwithers
    Layer Comps to PNG without Numeric Prefix?
    by jjwithers
    I'm going to be saving thousands of layer comps out to PNGs from a series of PSD files and i recently noticed that the script adds a numbered prefix to the name of the files. I do not want this number. Is there any way to run the script without the prefix?
    The file names will have to be specific...
    10-04-2010, 11:56 PM
  • acollazo
    Script for Renaming Layers
    by acollazo
    Hello. I came to RetouchPro by following a link from Adobe Forums which said, "There is an excellent script available for Photoshop which allows you to not only replace words in layer names, but also insert words as Prefixes, Suffixes and Sequential Numbers." But I cannot find this "excellent...
    Are there any scripts to find and replace layer names? There is an excellent script available for Photoshop which allows you to not only replace words
    05-17-2018, 09:41 AM
  • Sequitur
    Script to find/replace text in layer names?
    by Sequitur
    I'm looking for a script that can do a standard text "find and replace" of group names and layer names within photoshop. I'm not sure if this is actually doable, but it would be helpful if anyone knows of such a routine. I'm working with documents that have 1000+ layers that need to conform...
    09-16-2008, 01:39 PM
  • G>>
    Looping script with new parameters
    by G>>
    I'm trying to make this script working in a loop and change parameters in each new loop:

    var layerRef = app.activeDocument.artLayers.getByName("1");
    layerRef.visible = true;

    function saveJPEG( doc, saveFile, qty ) {
    var saveOptions = new JPEGSaveOptions(...
    09-01-2015, 07:59 AM
  • mantra
    is there a way to record a script or convert ?
    by mantra

    i understand nothing about script

    but is there a way to record a script?
    i mean like an action

    for example click and select a tool , the hand tool , and let photoshop write the script (that have the command to select the hand tool)
    03-28-2012, 12:01 AM