Export Layers to PSD

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.

image gallery

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.

image gallery

➊ 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 AllDeselect 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.

  1. Enter a folder path or click Browse.
  2. Check the number of selected files and skipped items.
  3. Review the filename previews.
  4. 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.

Leave a comment

Export Layers to PSD

Version: 1.0.0

Updated:

  • 1.0.0 – Initial release.

    Tested on MacOS:

    • Adobe Photoshop 2025 (26.0)
  • Supported Versions:

    • Compatible with Adobe Photoshop CS6 and later, including Adobe Photoshop CC versions.

    Operating Systems:

    • Works on both macOS and Windows platforms.
  • End User License Agreement (EULA)

    Last Updated: 21.12.2024

    This End User License Agreement (“Agreement”) is a legal agreement between you (“User” or “Licensee”) and Samolevsky.com (“Licensor”) regarding the use of the Adobe Illustrator scripts (“Software”). By downloading, installing, or using the Software, you agree to be bound by the terms of this Agreement.

    1. Grant of License

    Licensor grants the User a non-exclusive, non-transferable, and revocable license to use the Software in accordance with this Agreement.

    • Free Software: If the Software is provided for free, you may use it for personal or commercial purposes without payment, subject to the restrictions outlined in this Agreement.
    • Paid Software: If the Software is provided for a fee, you may use it only after payment has been made in full.

    2. Usage Rights

    You are permitted to:

    • Install and use the Software on devices you own or control.
    • Use the Software in your personal or commercial projects, subject to compliance with this Agreement.

    3. Restrictions

    You may NOT:

    • Reverse engineer, decompile, or otherwise attempt to discover the source code, underlying ideas, or algorithms of the Software.
    • Reuse, incorporate, or integrate any portion of the Software into any other software, product, or project, except as expressly permitted by the Licensor in writing.
    • Resell, redistribute, or share the Software, whether in its original or modified form, without prior written consent from the Licensor.
    • Claim ownership of the Software or its underlying code.
    • Use the Software in any way that violates applicable laws or regulations.

    4. Ownership

    The Software and all intellectual property rights therein remain the exclusive property of the Licensor. This Agreement does not transfer ownership of the Software or any intellectual property rights to the User.

    5. Disclaimer of Warranties

    THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT. IN NO EVENT SHALL THE LICENSOR BE LIABLE FOR ANY CLAIM, DAMAGES, OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT, OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

    6. Limitation of Liability

    To the maximum extent permitted by law, Licensor shall not be liable for any damages, including but not limited to direct, indirect, incidental, special, or consequential damages, arising out of or related to the use or inability to use the Software.

    7. Termination

    This Agreement is effective until terminated. Licensor may terminate this Agreement immediately if you breach any term of this Agreement. Upon termination, you must cease all use of the Software and destroy any copies in your possession.

    8. Updates and Support

    Licensor is not obligated to provide updates, support, or maintenance for the Software. However, updates may be provided at the sole discretion of the Licensor.

    9. Governing Law

    This Agreement shall be governed by and construed in accordance with the laws of the State of New York, without regard to its conflict of law principles.

    10. Entire Agreement

    This Agreement constitutes the entire agreement between you and the Licensor concerning the Software and supersedes all prior or contemporaneous understandings regarding such subject matter.

    By using the Software, you acknowledge that you have read this Agreement, understand it, and agree to be bound by its terms.

    For any questions or concerns regarding this Agreement, please contact us at hello@samolevsky.com

Required Software

Adobe Photoshop

Adobe Photoshop is a leading image editing and graphic design software developed by Adobe Inc. Renowned for its versatility, Photoshop is used by photographers, designers, and digital artists for tasks ranging from photo retouching and compositing to digital painting and creating web graphics. Its robust set of tools includes advanced layering, masking, and blending options, as well as powerful filters, adjustments, and AI-driven features like content-aware fill. Photoshop supports both raster and vector workflows, making it ideal for a wide range of creative projects, including print, web, and multimedia design. As part of Adobe Creative Cloud, it integrates seamlessly with other Adobe apps.

  • 🅰 Locating the Scripts Folder

    To install a Export Layers to PSD.jsx script in Adobe Photoshop, you need to place it in the correct directory where Photoshop
can recognize it. Follow these steps to locate the Scripts folder:

    1. MacOS:
      Open Finder and navigate to:
      /Applications/Adobe Photoshop [Version]/Presets/Scripts/
    2. Windows:
      Open File Explorer and navigate to:
      C:\Program Files\Adobe\Adobe Photoshop [Version]\Presets\Scripts\
    3. Replace <Version> with your Adobe Photoshop version (e.g., 2025).
    4. Replace <Language> with your language folder (e.g., "de_DE" for German, "en_US" for English).

    🅱 Installing the Script

    1. Copy the Script File: Copy the Export Layers to PSD.jsx file to the Scripts folder located in the path above.
    2. On some systems, you may need administrator permissions to modify the Scripts folder.
    3. Restart Adobe PhotoshopTo refresh the scripts menu, close and reopen Adobe Photoshop.

    Explore our complete guide to mastering Adobe Photoshop scripts.

    1. Open Adobe Photoshop and ensure a document is active.
    2. Go to the top menu bar and select File > Scripts.
    3. If the script is installed in the Scripts folder, it will appear in the dropdown list.
    4. Click the Export Layers to PSD script to run it.
    5. The Export Layers to PSD script will execute, and any dialog boxes or results will appear based on the script’s functionality.

    ☻ Before running any scripts, it’s strongly advised to save your work — especially when working with complex or large documents.

Got questions?

Need help or have an idea to share? We’d love to hear from you! Whether you have questions, found a bug, have a feature request, or just want to share your feedback, reach out to us—we’re here for you! 

Browse More Scripts

  1. Explore Export Layers to PSD
    Export Layers to PSD

    Export Layers to PSD

    This script turns selected Photoshop layers and groups into separate, fully layered PSD files.

    Explore
  2. Explore Ungroup All Groups
    Ungroup All Groups

    Ungroup All Groups

    Ungroup All Groups is a powerful Adobe Photoshop script that allows you to intelligently ungroup layer groups (including nested ones) in your currently active document. 

    Explore