Skip to main content
Participant
May 31, 2018
Answered

Locked Background layers by default

  • May 31, 2018
  • 5 replies
  • 6060 views

Is there a way to make the background layer in photoshop stop being locked by default. So I don't have to unlock it manually all the time?

Thanks!

    This topic has been closed for replies.
    Correct answer Bojan Živković11378569

    You can record an action to automate that task. There is Script Event Listener (File > Scripts > Script Events Manager) which you can try to automatically play action when opening documents. Another way is to record the action with two steps: step Open and step to convert Background layer to normal layer.

    When recording action use Insert Menu Item from Action panel menu to record step Open. Open any document, resume recording action then click on the padlock to unlock Background layer. Stop recording the action. Lastly, assign a keyboard shortcut to action.

    5 replies

    Stephen Marsh
    Community Expert
    Community Expert
    March 15, 2024

    An old topic, however, as it was bumped.

     

    Photoshop ships with this by default, it just needs to be activated in the Scripts Events Manager, no need to make an action or script as the script comes with the default installation of Photoshop. Of course, if you want a different name than the document name with extension, then you will need a custom action or script.

     

     

    This default script can be found in your program/application folder – Adobe Photoshop 2024/Presets/Scripts/Event Scripts Only/Open As Layer.jsx

     

    There is a modified version floating around that removes the filename extension:

     

    // (c) Copyright 2008.  Adobe Systems, Incorporated.  All rights reserved.
    
    /*
    @@@BUILDINFO@@@ OpenAsLayer.jsx 1.1.0.0
    */
    
    var begDesc = "$$$/JavaScripts/OpenAsLayer/Description=Assign this to the open document event. This will promote a document with only a background layer to a layer with the document name." // endDesc
    
    
    // on localized builds we pull the $$$/Strings from a .dat file, see documentation for more details
    $.localize = true;
    
    var stripExtension = true;
    
    if ( app.documents.length > 0 ) {
    	var doc = activeDocument;
    	if ( doc.layers.length == 1 && doc.activeLayer.isBackgroundLayer ) {
    		doc.activeLayer.isBackgroundLayer = false;
    		var docNameNoExtension = doc.name;
    		if (stripExtension) {
    			var extensionIndex = docNameNoExtension.lastIndexOf (".");
    			if (extensionIndex != -1) {
    				docNameNoExtension = docNameNoExtension.substr(0, extensionIndex);
    			}
    		}
    		doc.activeLayer.name = docNameNoExtension;
    	}
    }

     

    Participant
    March 15, 2024

    Save this script as .js file and add an Event as "Open File" (see Bojan Živković reply)

    // Check if there is an open document
    if (app.documents.length > 0) {
    var doc = app.activeDocument; // Get the active document

    // Check if the active layer is the background layer
    if (doc.activeLayer.isBackgroundLayer) {
    // Directly unlock the background layer by renaming it
    doc.activeLayer.isBackgroundLayer = false;
    doc.activeLayer.name = "Layer 0"; // Rename the layer
    } else {
    alert("The active layer is not the background layer.");
    }
    } else {
    alert("There are no open documents.");
    }

    pSyalvia
    Participant
    April 24, 2020

    I think the initial question was for automate this task without shortcut or script stuff. Because a simple double click can unlock the background layer 🙂

    JJMack
    Community Expert
    Community Expert
    May 31, 2018

    No Photoshop background layer does not support transparency.  Its transparency will always be locked. The layer is not fully locked.  To get rid of the transparency lock you must convert the background layer to a normal layer it will not longer be a background layer and other can be moved below the normal layer that once was the bottom background layer.

    JJMack
    Bojan Živković11378569
    Community Expert
    Community Expert
    May 31, 2018

    You can record an action to automate that task. There is Script Event Listener (File > Scripts > Script Events Manager) which you can try to automatically play action when opening documents. Another way is to record the action with two steps: step Open and step to convert Background layer to normal layer.

    When recording action use Insert Menu Item from Action panel menu to record step Open. Open any document, resume recording action then click on the padlock to unlock Background layer. Stop recording the action. Lastly, assign a keyboard shortcut to action.