Skip to main content
Known Participant
September 6, 2021
Open for Voting

Option to Disable "Jpeg Options" Pop Up After Saving

  • September 6, 2021
  • 12 replies
  • 2874 views

After I close/save a Jpeg, Photoshop displays a pop up labeled "Jpeg Options". I save the same way for all of my photos so it would be nice to be able to set a default, disable this pop up asking the same thing everytime, and and not have to click "OK" on 1000's of photos.

12 replies

Stephen Marsh
Community Expert
Community Expert
September 21, 2023

@TRAVELARIUM 

 

With your suggested change to my code, files saved with a non-standard four-character .JPEG extension will now be saved with .JPG... So now there will be two files, with the new file having a three-character extension and the original four-character extension unchanged!

 

This could be coded around, but the whole point was to bring to the user's attention that the file used JPEG rather than JPG, which is a real issue. My coding wasn't intended to be circumvented, so I can't agree with your suggested modification.

TRAVELARIUM
Participating Frequently
September 21, 2023

A small change to make the script work with both JPEG and JPG extensions at the same time.

Need to change:

if (/\.jpg$/i.test(activeDocument.name) === true) {

 to:

if (/\.jpe?g$/i.test(activeDocument.name) === true) {

 

Stephen Marsh
Community Expert
Community Expert
March 22, 2023

@julesbower 

 

You're welcome, feedback is always appreciated and welcome, this is just my take, you may wish for additions or removal of certain features.

Participant
March 22, 2023

Thank you Stephen! Your time and kindness providing this solution is immensley appreciated 🙂

Stephen Marsh
Community Expert
Community Expert
March 22, 2023

The following script silently overwrites an existing JPG file without offering the format options dialog box.

 

It is easy to enable the option to confirm overwriting the file if needed, without changing the file options.

 

Don't use with non-JPG files as it will flatten/convert to 8bpc/remove alphas to force the file to meet the file format requirements without saving as a copy. Use at your own risk. Not intended for use with the Script Events Manager. Once installed, a custom keyboard shortcut can be applied.

 

/*
Overwrite JPEG Without Dialog.jsx
v1.1 - 22nd March 2023, Stephen Marsh
https://community.adobe.com/t5/photoshop-ecosystem-discussions/what-happened-to-closing-a-file-and-having-it-save-changes/td-p/13658507
Based on:
https://community.adobe.com/t5/photoshop-ecosystem-ideas/option-to-disable-quot-jpeg-options-quot-pop-up-after-saving/idc-p/12662182
https://community.adobe.com/t5/photoshop-ecosystem-discussions/how-to-bypass-quot-jpeg-options-quot-when-saving-jpg-files-under-photoshop-v23-1/m-p/12597240
*/

#target photoshop

if (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!
        try {
            // Use the previously saved directory path
            var docPath = activeDocument.path;
        } catch (e) {
            // If unsaved, prompt for the save path
            alert('Unsaved file, save the file manually!');
        }

        var docName = activeDocument.name;
        var saveFileJPEG = new File(docPath + '/' + docName);

        // The overwrite check isn't needed for this script, but the code is retained for reference purposes...
        /*
        // Prompt to overwrite existing file
        if (saveFileJPEG.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 file conforms to the JPEG specification
        activeDocument.bitsPerChannel = BitsPerChannelType.EIGHT;
        activeDocument.flatten();
        activeDocument.channels.removeAll();

        // Call the function to save the file
        jpegOptions(saveFileJPEG);

        // End of script
        // app.beep();
        // alert('JPEG saved!');

    } 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!');
}


// JPEG save function
function jpegOptions(saveFileJPEG) {
    jpgSaveOptions = new JPEGSaveOptions();
    jpgSaveOptions.matte = MatteType.NONE;
    jpgSaveOptions.embedColorProfile = true;
    // STANDARDBASELINE | OPTIMIZEDBASELINE | PROGRESSIVE
    jpgSaveOptions.formatOptions = FormatOptions.STANDARDBASELINE;
    // Quality  0 low quality - 12 high quality
    jpgSaveOptions.quality = 10;
    // Only valid for Progressive: 3 - 5
    if (jpgSaveOptions.formatOptions == FormatOptions.PROGRESSIVE) {
        jpgSaveOptions.scans = 3;
    }
    // Save and overwrite the original
    activeDocument.saveAs(saveFileJPEG, jpgSaveOptions, false);
}

 

  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#Photoshop

 

Stephen Marsh
Community Expert
Community Expert
March 22, 2023

@julesbower wrote:

 

quote

Hi, I downloaded the script and tried it out but I think I am missing something. Like in the original question I would love a script that automatically saves to the same location at max quality without having to confirm via the jpeg options popup. I have installed this script and in the script manager chose the Save Document trigger but I see that the script still opens the photoshop jpeg options popup and then once I close that it opens a further custom save as popup. Have I done something wrong or is that the correct functionality?

 

For max quality change:

 

jpgSaveOptions.quality = 10;

 

to:

 

jpgSaveOptions.quality = 12;

 

However, the script was written with a different intent than what you require and wasn't intended for use with the Script Events Manager, I'll post new code...

 

Participant
March 21, 2023

Hi, I downloaded the script and tried it out but I think I am missing something. Like in the original question I would love a script that automatically saves to the same location at max quality without having to confirm via the jpeg options popup. I have installed this script and in the script manager chose the Save Document trigger but I see that the script still opens the photoshop jpeg options popup and then once I close that it opens a further custom save as popup. Have I done something wrong or is that the correct functionality?

Stephen Marsh
Community Expert
Community Expert
January 31, 2022
quote

This is awesome, Stephen. Thanks for putting it together. I'll let you know how it goes!

 

@defaultb0i85kbn1psp – so, how did the script go?

Participant
January 15, 2022

This is awesome, Stephen. Thanks for putting it together. I'll let you know how it goes!

Stephen Marsh
Community Expert
Community Expert
January 14, 2022

Here is the script, let me know if there are any problems or issues. Use at your own risk.

 

/*
Custom JPEG Save As to Baseline Standard.jsx
https://community.adobe.com/t5/photoshop-ecosystem-ideas/option-to-disable-quot-jpeg-options-quot-pop-up-after-saving/idc-p/12662182#M12329
Stephen Marsh, 15th January 2022 - v1.1
Info: Uses a custom prompt interface to *SAVE A COPY* with quality level 10 standard/baseline JPEG to a user selected-folder
*/

#target photoshop

if (app.documents.length !== 0) {
	// Remove extension
	var docName = app.activeDocument.name.replace(/\.[^\.]+$/, '');
	var docNameInput = prompt('Enter a filename (without extension):', docName);
	// Remove extension
	var docNameOutput = docNameInput.replace(/\.[^\.]+$/, '');
	var docPath = Folder.selectDialog('Select a folder to save the JPEG image to...');

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

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

	jpegOptions(saveFileJPEG);

	// JPEG Options
	function jpegOptions(saveFileJPEG) {
		jpgSaveOptions = new JPEGSaveOptions();
		jpgSaveOptions.embedColorProfile = true;
		jpgSaveOptions.formatOptions = FormatOptions.STANDARDBASELINE;
		jpgSaveOptions.matte = MatteType.NONE;
		jpgSaveOptions.quality = 10;
		// Save a Copy
		activeDocument.saveAs(saveFileJPEG, jpgSaveOptions, true, Extension.LOWERCASE);
	}

	app.beep();
	// alert('JPEG saved!');

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

 

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