Announcement

Collapse
No announcement yet.

Targeted layer visibility toggle script

Collapse
X
 
  • 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:

    Code:
    Layer0
    Layer1 [T]
    Layer2
    Layer3
    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.

    Limitations
    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.

    Code:
    Layer0
    Group0
      Layer1
      Layer2
    Group1
      Layer3
      Layer4
      Group2
        Layer5
    Attached Files

Related Topics

Collapse

  • 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, 10: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, 08: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, 12: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, 06:59 AM
  • mantra
    is there a way to record a script or convert ?
    by mantra
    Hi

    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-27-2012, 11:01 PM
Working...
X