Skip to main content
stevee42461995
Participant
September 13, 2026
Question

"save as type" keeps going to photoshop extension, I want it to default to 'jpg.

  • September 13, 2026
  • 5 replies
  • 32 views

When done editing a jpg. It says “save as type” and defaults to a photoshop extension every time. other versions never did this. Very time consuming when you have 400 plus photos to do. Any help here?

 

    5 replies

    Stephen Marsh
    Community Expert
    Community Expert
    September 13, 2026

    This script is designed to automate re-saving a JPEG as a JPEG, regardless of any edits performed while open, which might invalidate the JPEG save.

    It saves the active document as a JPEG back into its source folder. It first checks that the open file has a standard three-letter .jpg extension. If the image is currently 32-bit HDR, it is tone-mapped down to 8-bit first, using the Exposure/Gamma method. It then resolves the save path (prompting for a folder if the file is unsaved), flattens and strips extra channels, and saves to baseline JPEG at quality 10 with the color profile embedded.

     

    /*
    JPG Save As a Copy to Source Directory with JPEG Extension Check.jsx
    Stephen Marsh
    v1.0 - 13th September 2026
    https://community.adobe.com/questions-712/save-as-type-keeps-going-to-photoshop-extension-i-want-it-to-default-to-jpg-1641653
    Based on:
    https://community.adobe.com/t5/photoshop-ecosystem-ideas/saving-jpegs-via-an-action/idc-p/15002989
    */

    #target photoshop

    if (app.documents.length) {

    // Add a conditional check for .jpg extension in the filename, not .jpeg!
    /* https://community.adobe.com/t5/photoshop-ecosystem-discussions/jpg-jpeg/m-p/12760785#U12762639 */
    if (/\.jpg$/i.test(activeDocument.name) === true) {
    // Move on, the extension is standard!

    // Check if the bit depth is 32 bpc
    if (app.activeDocument.bitsPerChannel == BitsPerChannelType.THIRTYTWO) {
    //throw alert("Script cancelled!\rThe image mode is 32 bpc, tone mapping to 8 or 16 bpc is required before continuing.");
    mergeHDRto8bit(8, 6, 0, 1, false);
    }

    var docName = app.activeDocument.name.replace(/\.[^\.]+$/, '');

    try {
    // Use the previously saved path
    var docPath = app.activeDocument.path;
    } catch (e) {
    // If unsaved, prompt for save directory
    var docPath = new Folder.selectDialog("Unsaved base file, select the output folder:");
    }

    // File Path & Naming
    var nameAndPath = new File(docPath + '/' + docName + '.jpg');

    // Disable the confirmation to silently overwrite
    /*
    if (nameAndPath.exists) {
    // true = 'No' as default active button
    if (!confirm("File exists, overwrite: Yes or No?", true))
    // throw alert("Script cancelled!");
    throw null;
    }
    */

    // Esnsure the the active doc conforms to the JPEG specification
    activeDocument.bitsPerChannel = BitsPerChannelType.EIGHT;
    activeDocument.flatten();
    activeDocument.channels.removeAll();
    saveJPEG(nameAndPath);

    //app.activeDocument.close(SaveOptions.DONOTSAVECHANGES);


    } else if (/\.jpeg$/i.test(activeDocument.name) === true) {
    alert("This document uses a non-standard four character file extension of 'jpEg'..." + "\n" + "You will need to fix this yourself!");
    } else {
    alert("This script is only intended to be used with JPEG files!");
    }

    } else {
    alert("You must have a document open!");
    }


    function saveJPEG(saveDetails) {
    var jpgSaveOptions = new JPEGSaveOptions();
    jpgSaveOptions.embedColorProfile = true; // Boolean: true | false
    jpgSaveOptions.formatOptions = FormatOptions.STANDARDBASELINE; // FormatOptions.STANDARDBASELINE | FormatOptions.OPTIMIZEDBASELINE | FormatOptions.PROGRESSIVE
    jpgSaveOptions.matte = MatteType.NONE; // MatteType.NONE | MatteType.WHITE | MatteType.BLACK
    jpgSaveOptions.quality = 10; // Numeric: 0 - 12 (low quality to highest quality)
    app.activeDocument.saveAs(saveDetails, jpgSaveOptions, false, Extension.LOWERCASE); // true for save a copy
    }

    function mergeHDRto8bit(depth, version, exposure, gamma, deghosting) {
    var s2t = function (s) {
    return app.stringIDToTypeID(s);
    };
    var descriptor = new ActionDescriptor();
    var descriptor2 = new ActionDescriptor();
    descriptor.putInteger( s2t( "depth" ), depth );
    descriptor2.putInteger( s2t( "version" ), version );
    descriptor2.putEnumerated( s2t( "method" ), s2t( "hdrToningMethodType" ), s2t( "hdrtype2" ));
    descriptor2.putDouble( s2t( "exposure" ), exposure );
    descriptor2.putDouble( s2t( "gamma" ), gamma );
    descriptor2.putBoolean( s2t( "deghosting" ), deghosting );
    descriptor.putObject( s2t( "with" ), s2t( "hdrOptions" ), descriptor2 );
    executeAction( s2t( "convertMode" ), descriptor, DialogModes.NO );
    }

     

    1. Copy the code text to the clipboard
    2. Open a new blank file in a plain-text editor (not in a word processor)
    3. Paste the code in
    4. Save as a plain text format file – .txt
    5. Rename the saved file extension from .txt to .jsx
    6. Install or browse to the .jsx file to run (see below):

    https://prepression.blogspot.com/2017/11/downloading-and-installing-adobe-scripts.html

    Stephen Marsh
    Community Expert
    Community Expert
    September 13, 2026

    Were the JPEG files created in non-Adobe software? If so, then they are using a non-compatible compression and or other options, which forces the Photoshop dialog.

    c.pfaffenbichler
    Community Expert
    Community Expert
    September 13, 2026

    Aside from those issues it seems best not to resave jpgs repeatedly because of the increasing compression damage.

    JohanElzenga
    Community Expert
    Community Expert
    September 13, 2026

    Check this preference setting. Make sure it is not checked. Also if you use the crop tool, make sure ‘delete cropped pixels’ is checked.

     

    -- Johan W. Elzenga
    c.pfaffenbichler
    Community Expert
    Community Expert
    September 13, 2026

    Have you created something that is impossible in jpg, like layers, 16bit, ...?

    Please post meaningful screenshot including all pertinent panels.