What's new
Photoshop Gurus Forum

Welcome to Photoshop Gurus forum. Register a free account today to become a member! It's completely free. Once signed in, you'll enjoy an ad-free experience and be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

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


darthsmozers

Member
Messages
13
Likes
0
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?)
 
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]);
		}
	}
}
 
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.
 
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.
 

Back
Top