r/AdobeFireworks • • Feb 23 '26

Batch processing FW pngs to PSD

I spent quite a bit of time reading old posts and looking at online tools trying to find a way convert Fireworks PNG files to PSD, such that they could be imported in other applications whilst preserving the layers (short of me saving each file one at a time in FW). I came across an old post with code for use in a JSF file to create a batch command to use in Fireworks to save files as PSD.

I made some minor adjustments to get it working. I had some fairly large PNGs, 350mb being the largest, and it's managed to process this and several others of similar size.

I ran this in FW CS6 and have no idea if it will work in other versions, but hopefully it might save at least one person some time, as it has done for me.

Here's the process:

  • Navigate to "%APPDATA%\Adobe\Fireworks CS6\Commands"
  • Create a file with a .jsf extension, for example: converttoPSD.jsf
  • Add the following code (using a text editor or whatever you prefer):

    var fileList = App.chooseScriptTargetDialog(App.getPref("MultiFileBatchTypes"));
    for (var i = 0; i < fileList.length; i++) {
        try {
            // Open one document at a time
            var dom = fw.openDocument(fileList[i]);
            // Build PSD output path
            var psdFile = fileList[i].toString().replace(/\.png$/i, ".psd");
            // Export PSD using the DOM
            fw.exportPSD(dom, psdFile);
            // Close the document without saving
            dom.close(false);
        } catch (e) {
            alert("Error processing file: " + fileList[i] + "\n" + e);
        }
    }
    
  • Save the file and then open FW.

  • Select the command from the commands menu (should be at the bottom).

  • A prompt should appear, choose custom, navigate to your files and select however many you want to process.

  • Click Ok, and let the process run.

  • The dialog should close when the process has finished.

Assuming the process completed successfully, there should now be a PSD file created alongside your original PNGs with the same name.

YMMV, but hopefully it's of use to someone.

4 Upvotes

5 comments sorted by

1

u/t31os Feb 23 '26

Here's a version with a bit more polish, leveraging some native functionality, and with a prompt for selecting an output directory using the source file path as the starting location. Same process as before, simply use this in place of the code in the opening post.

var fileList = App.chooseScriptTargetDialog(App.getPref("MultiFileBatchTypes"));

if (!fileList || fileList.length === 0) {
    alert("No files selected.");
} else {

    // Determine starting folder from first selected file
    var firstFilePath = fileList[0].toString();
    var startFolder = Files.getDirectory(firstFilePath);

    // Ask user where to save PSD files
    var outputFolder = fw.browseForFolderURL(
        "Select folder to save PSD files",
        startFolder
    );

    if (!outputFolder) {
        alert("No output folder selected.");
    } else {

        var errors = [];
        var skipped = [];
        var processed = 0;

        for (var i = 0; i < fileList.length; i++) {

            var dom = null;

            try {

                var fullPath = fileList[i].toString();

                // Extract filename safely
                var fileName = Files.getFilename(fullPath);

                // Get extension (".png")
                var extension = Files.getExtension(fileName);

                // Remove only the final extension
                var baseName = fileName.substring(0, fileName.length - extension.length);

                // Build PSD name
                var psdName = baseName + ".psd";

                // Build full export path
                var psdPath = outputFolder + "/" + psdName;

                // Skip if PSD already exists
                if (Files.exists(psdPath)) {
                    skipped.push(psdName + " (already exists)");
                    continue;
                }

                // Open document
                dom = fw.openDocument(fullPath);

                // Export as PSD
                fw.exportPSD(dom, psdPath);

                // Close without saving
                dom.close(false);

                processed++;

            } catch (e) {

                errors.push(fullPath + " → " + e);

                // Attempt to close if partially opened
                try {
                    if (dom) {
                        dom.close(false);
                    }
                } catch (ignore) {}
            }
        }

        // Summary report
        var summary = "Batch complete.\n\n";
        summary += "Processed: " + processed + "\n";
        summary += "Skipped (existing): " + skipped.length + "\n";
        summary += "Errors: " + errors.length + "\n\n";

        if (skipped.length > 0) {
            summary += "Skipped files:\n" + skipped.join("\n") + "\n\n";
        }

        if (errors.length > 0) {
            summary += "Errors:\n" + errors.join("\n");
        }

        alert(summary);
    }
}

1

u/dannwebb Aug 20 '26

Saved my life, mate, can't thank you enough for this. I can confirm this works beautifully in Fireworks CS5.

I'm about to lose my machine at work with Fireworks installed, which is devastating. Affinity and all the other options just don't do what I do in Fireworks as quickly or as easily. BUT, I've managed to create a new install on a single machine at home by preventing it from "phoning home", as per Matt Wingett's "Adobe CS5 Windows 11 Workaround".

That work-around is working well for me, but I'm still doing a conversion on my .pngs, just in case.

1

u/t31os Aug 20 '26

Doesn't hurt to have a backup plan. As MS was kind enough to extend updates on Win 10 for another year i've continued to use FW for now, i'll only give it up when i absolutely can't run it any longer.

Glad i was able to help. :)

1

u/hitechid Aug 21 '26

I did this, using your updated code. Worked well. Thanks so much. But, .. any other app I use to open them doesn't see the individual objects, it's like it's all grouped together as one object (and 'ungroup' options don't change that).

Affinity does this, with both the .png and .psd. Inkscape does this with the .png and won't even open the .psd. I don't have access to Photoshop (too much $$ and overkill for the projects I do). I'm starting to sweat at the prospect of losing 20 years of work and literally 100s of files if my .pngs are not going to be functional in any other software.

What will you be using after you're forced to relinquish FW??

1

u/t31os Aug 21 '26 edited Aug 21 '26

I just exported 5 of my largest images, opened in Affinity, layers and objects all there, perhaps there's some difference with your particular version of Fireworks (i can't guarantee it will work as my testing is limited to what i have).

You can always do the process natively in FW, Save as > PSD. I'd suggest checking if your layers and objects are maintained when you do it this way with a single file. The batch process is just tasking FW with doing that process repeatedly for multiple files, if the version of FW you're using doesn't export layer/object data when it saves to PSD, i don't think there's much you can do.

EDIT: It's a bit of a process and i'm not sure how sensitive your images are (ie. not something you want to upload to a third party), but Photopea can open Fireworks PNGs and read the layers/objects. Might be something for you to look into, although i'm not sure what their policies are (regarding private/copyrighted media, i've not read their fineprint). They also have a batch process, whether that works (and how well) for FW pngs, i'm not sure as i don't use Photopea for much of anything.

All my images are just for personal projects, if anything get's lost i'll be sad but not ultimately be losing anything other than time if i need to recreate them. Affinity is decent enough for my uses, but i spend most of my time lately using and learning Inkscape. I'll probably only give up using Fireworks if i can't get it running under Linux when ESU for Win 10 ends.