Export Layers to PSD
Script for Adobe Photoshop
✦ Available exclusively on Patreon for Pro supporters.
ㅤ
Description
Export Layers to PSD turns selected Photoshop layers and groups into separate, fully layered PSD files. It provides precise control over which items are exported, how grouped content is handled, how files are named and organized, and whether each exported document is trimmed, scaled, or padded.
ㅤ
Features
The script combines layer selection, file naming, document modification, and destination controls in one resizable export dialog, with a live preview of every resulting filename.
- Flexible layer export: Export selected layers, complete groups, or individual layers inside groups as separate PSD files.
- Selection controls: Start from the current Layers panel selection, then refine it with Select All, Deselect All, Invert, or Cmd/Ctrl-click.
- Layer search: Find layers by name or group path without removing selected items hidden by the search.
- Export filters: Skip hidden layers, empty layers, groups and grouped layers, or names beginning with a case-sensitive prefix.
- Companion layers: Preserve the document’s topmost root layer as a foreground and/or its bottommost root layer as a background in every PSD.
- Group path options: Ignore group paths, add them to filenames, or recreate them as destination subfolders.
- Custom filenames: Build names from an optional prefix, layer name, zero-padded sequence number, and optional suffix.
- Capitalization rules: Apply original, uppercase, lowercase, title case, or sentence case capitalization.
- Live filename preview: See the exact PSD filename for every selected row before exporting.
- Flexible trimming: Trim to each layer’s bounds, each PSD’s transparent pixels, or the combined selected bounds.
- Scale and padding: Resize exported PSDs by percentage and add equal pixel padding on all sides.
ㅤ

ㅤ
Installation
1. Download the Export Layers to PSD.jsx script file.
2. Place the script in your Adobe Photoshop Scripts folder:
⮑ Mac: /Applications/Adobe Photoshop (Version)/Presets/Scripts/
⮑ Windows: C:\Program Files\Adobe\Adobe Photoshop (Version)\Presets\Scripts\
3. Restart Adobe Photoshop if it's already running.
4. Access the script via File > Scripts > Export Layers to PSD
ㅤ
Using the Script
ㅤ
Prepare Your Layers
Open the Photoshop document you want to export. The script creates new PSD files without changing the original document.
- Give layers and groups clear names. These names can be used for the exported files.
- Put layers in the preferred order. Numbered files follow the layer stacking order.
- Select the layers you want to export before opening the script. If nothing usable is selected, all available items are selected automatically.
- Save the document first if you want its folder to appear as the default export location. Unsaved documents default to the Desktop.
ㅤ
ㅤ
Open the Script
Choose File > Scripts > Export Layers to PSD.
The list at the top shows the available layers and groups:
- Highlighted rows will be exported.
- The File name column shows the name of each resulting PSD.
- A blank filename means that the row will not be exported as a separate file.
- Labels such as hidden, empty, foreground, or background explain the state of a layer.
- Hover over any control to see a short help tip.
ㅤ

ㅤ
➊ Select What to Export
Use the layer list to choose which items will become separate PSD files.
- Cmd-click on macOS or Ctrl-click on Windows to select or deselect individual rows.
- Use Select All, Deselect All, or Invert to change the visible selection.
- Use Search layers to find a layer by name or group path.
- Clear the search field to show the full list again.
ㅤ
You can also remove unwanted items with filters:
- Ignore layers starting with excludes names that begin with the entered prefix. The prefix is case-sensitive.
- Skip hidden layers excludes hidden items.
- Skip empty layers excludes items with no content.
- Skip groups and grouped layers leaves only ungrouped top-level layers.
Search only hides rows from view. A selected layer remains selected and will still export even when it does not match the current search.
ㅤ
ㅤ
➋ Choose How Groups Are Exported
If the document contains groups, choose the behavior that matches the result you want:
- Save each group as one PSD keeps every group together as a layered file.
- Save each layer inside groups as one PSD exports the layers inside groups separately.
- Show groups and layers for manual selection lets you choose from the full layer tree.
ㅤ
Then choose how group paths affect the exported files:
- Do not use group paths saves every PSD directly in the destination folder.
- Add the group path to each file name adds parent group names to each filename.
- Create matching group subfolders recreates the group structure as folders.
In manual mode, selecting a group deselects its contents, and selecting a layer inside a group deselects the group. This prevents the same content from being exported twice.
ㅤ
ㅤ
➌ Add a Shared Foreground or Background
Use Layers included in every PSD when every exported file needs the same artwork.
- Keep “[layer name]” as foreground adds the document’s topmost root layer to every PSD.
- Keep “[layer name]” as background adds the document’s bottommost root layer to every PSD.
- Keep chosen layer in every PSD lets you include any layer or group from the document.
The first two options show the actual layer names from the document. The chosen-layer menu shows the complete layer tree, including nested layers and groups.
Companion layers are included in every file but are not exported as separate PSDs. Use them for watermarks, overlays, textures, frames, or background colors.
ㅤ
ㅤ
➍ Adjust the Size or Canvas
The controls in Modify exported PSDs are optional.
- Each layer’s bounds trims every PSD to its exported layer.
- Each PSD’s transparent pixels trims every PSD to all visible content in that file.
- Combined selected bounds gives every PSD the same crop based on all selected content.
- Scale resizes every PSD by a percentage.
- Padding adds the same number of pixels to every side.
When several options are enabled, the script applies them in this order: trim, scale, padding.
Use the Up and Down arrow keys to adjust a value. Hold Shift for larger steps, or Cmd/Ctrl in the Scale field for 0.1 increments.
ㅤ
ㅤ
➎ Set the Filenames
Use File naming to build the exported names. The filename preview updates as you change the options.
- Add an optional prefix or suffix.
- Use the layer name, a sequence number, or both.
- Choose a capitalization style.
- Check the File name column to confirm the final names and folder paths.
Sequence numbers follow the layer stacking order and use at least two digits. Invalid filename characters are replaced automatically, and duplicate names receive suffixes such as _2 and _3.
ㅤ
ㅤ
➏ Export the PSD Files
Choose where the files should be saved, review the summary, and start the export.
- Enter a folder path or click Browse.
- Check the number of selected files and skipped items.
- Review the filename previews.
- Click Export selected.
The script creates a missing destination folder when possible. It also creates any required group subfolders and remembers the chosen destination for the next session.
ㅤ
ㅤ
➐ Check the Results
Photoshop shows the export progress and the name of the layer currently being processed.
- Use Cancel to stop after the current file finishes.
- Files completed before cancellation remain saved.
- Exported PSDs keep their editable layers and embedded color profile.
- The final message reports the number of completed files, elapsed time, and destination.
The script remembers most settings for the next session. Search text and the current layer selection are not saved.
ㅤ
ㅤ
☻ You’re Ready to Export
Choose your layers, confirm the filename previews, and let the script handle the rest. With a few simple options, even complex Photoshop documents can become neatly organized, ready-to-use PSD files.
ㅤ
ㅤ