Based a a customer request, Thomas modified the original scrips so that it now will open an image and convert the Background into a layer and name the layer the file name – without the extension.
Installing the OpenAsLayerNoExtension.jsx script will allow you to open a file and have Photoshop CS5 automatically promote the background into a layer AND rename that layer the same as the file name (without the extension). This script works for the Open command, opening files through Bridge and Adobe Camera Raw. Special thanks to Thomas Ruark at Adobe for creating and sharing this script!
Directions to install:
Copy the script into the Photoshop CS5 folder / Presets / Scripts / Event Scripts Only
Launch Photoshop CS5
Select File > Scripts > Script Events Manager
In the Script Events Manager dialog box:
Click to enable “Enable Events to Run Scripts/Actions:”
For Photoshop Event: use the drop down to select “Open Document”
In the Script drop down select “OpenAsLayer”
Click the Add button (it should show up in the upper list box)
Click the Done button
Open your document. In the Layers palette, the Background has been changed to a layer and renamed the document name. Note: This script will have no effect on documents that do not have a background layer.