Batch export with original folder names

Anyone, especially newbies, asking for help with Photoshop Scripting and Photoshop Automation - as opposed to those contributing to discussion about an aspect of Photoshop Scripting

Moderators: Tom, Kukurykus

loganparker
Posts: 1
Joined: Mon Aug 03, 2026 8:55 am

Batch export with original folder names

Post by loganparker »

Hi everyone,

I'm trying to automate a Photoshop workflow with JavaScript and can't find a solution that matches what I need.

I have a main folder containing dozens of subfolders, and each subfolder has several PSD files. I want the script to open every PSD, export it as a PNG, and save the PNG into a new output directory while preserving the original subfolder structure. For example:

Source: Projects/ClientA/design1.psd
Output: Exported/ClientA/design1.png

I know how to batch process files, but I'm not sure how to recreate the relative folder structure automatically during export. Is there a straightforward way to get the PSD's path relative to the root source folder and create the matching folders before saving?

Any example or suggestion would be greatly appreciated. Thanks!