+ Reply to Thread
Results 1 to 6 of 6
  1. #1
    Junior Member
    Join Date
    Nov 2009
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Any way to set all layers to 100% opacity at one time?

    I work with projects that contain numerous layers. I'd like to be able to reset all layers back to 100% opacity after working with them. Any shortcuts or actions to do this? (Perhaps incorporating the select-all-layers keyboard shortcut control+alt+A?)

  2. #2
    The Script Master
    Join Date
    May 2009
    Location
    Bradford,UK
    Posts
    187
    Thanks
    0
    Thanked 26 Times in 24 Posts
    This will iterate though all layersets and layers and set the opacity to 100.

    Code:
    #target photoshop
    if(documents.length){
    setLayerOpacity(app.activeDocument);
    }
    function setLayerOpacity(obj){ 
     if(obj.artLayers.length>0){
     for(var z = 0;z<obj.artLayers.length;z++){
       activeDocument.activeLayer=obj.layers[z];
       activeDocument.activeLayer.opacity=100;
    		} 
    	}
     if(obj.layerSets.length > 0){ 
      for(var l=0;l<obj.layerSets.length;l++){
    	activeDocument.activeLayer=obj.layerSets[l];
       activeDocument.activeLayer.opacity=100;
        setLayerOpacity(obj.layerSets[l]);
    		}
    	}
    }

  3. #3
    Junior Member
    Join Date
    Nov 2009
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Red face

    Thanks!

    I'm new to trying to automate things .. where do I paste that in exactly?

  4. #4
    The Script Master
    Join Date
    May 2009
    Location
    Bradford,UK
    Posts
    187
    Thanks
    0
    Thanked 26 Times in 24 Posts
    The best thing to do is to paste the code into ExtendScript Toolkit this can be found..

    PC: C:\Program Files\Adobe\Adobe Utilities
    MAC: <hard drive>/Applications/Utilities/Adobe Utilities
    Then save the script in..

    PC: C:\Program Files\Adobe\Adobe Photoshop CS#\Presets\Scripts
    MAC: <hard drive>/Applications/Adobe Photoshop CS#/ Presets/Scripts

    If Photoshop was open, close and restart Photoshop so that it can pick up the new script.
    You can then run the script by File - Scripts and choose the script or create an action that calls the script.

    Start you recording and from the action palette flyout choose "Insert Menu Item" now goto File - Scripts and choose the script, stop the recording.

  5. #5
    Junior Member
    Join Date
    Nov 2009
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Awesome, I'll give it a try and report back. Thanks for your help today!

  6. #6
    Junior Member
    Join Date
    Nov 2009
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Smile

    Fantastic! This is really working out. Thanks!

    I will create a new thread today with the next step I'm interested in solving, so I don't clutter this topic.

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Powered by vBulletin® Version 4.1.9
Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.
Content Relevant URLs by vBSEO 3.6.0
Copyright 2011 Photoshop Gurus Forum. All rights reserved.
All times are GMT -5. The time now is 11:12 PM.