Skip to main content
Participant
December 10, 2021
Question

Can't include "Export As..." in an Action

  • December 10, 2021
  • 1 reply
  • 366 views

I'm trying to create an action that exports a high-res tiff as a resized, low-quality jpg before it processes the original file further, but it doesn't record the "Export As..." menu option. Unfortunately, the "Save a Copy..." option, which can be used in the action, does not allow me to resize the image in the process. The only workaround has been to duplicate the image first before resizing, saving as a jpg, and then closing it to return to the original. This is a convoluted process for something the "Export As..." option does in one fell swoop.

This topic has been closed for replies.

1 reply

Stephen Marsh
Community Expert
Community Expert
December 11, 2021

The Generator based exports can't be recorded into an action or directly used in a script, Adobe are working on updating the export features, however I have not checked in recently to see what has changed.

 

The old Export > Save for Web (Legacy) command can be recorded into an action. If you don't change the filename it will record the save location allowing you to save multiple files with different names to the same recorded location. This includes all save for web features, including resizing.

 

Yes, you can dupe the current doc and resize and save as a workaround. One can also use smart objects or saved history states within the same document as alternatives to duping the doc... All of which add extra steps.

bask43317142
Participating Frequently
March 10, 2022

On My old Macbook I'm running CC 1.5. In this version we where able to generate actions with export> save for web. On my new Macbook I run CC 23.2.1 and unfortunately not possible to do this anymore. Makes me craze as I often make a lot of different file formats. Anyone a tip how to batch this?

 

Stephen Marsh
Community Expert
Community Expert
March 10, 2022

I am not aware of any lack of functionality in actions with M1 Macs for Export > Save for Web (Legacy). Has this disappeared from the Export menu or just doesn't record correctly anymore? You could use Rosetta 2 if this made a difference... What about old actions, do they work?

 

Do scripts such as this one work?

/* This script exports a Save for Web JPEG to a user selected-folder, replacing file name word spaces with hyphens */

#target photoshop

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

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

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

    SaveForWeb(saveFileJPEG);

    // JPEG S4W Options
    function SaveForWeb(saveFileJPEG) {
        var sfwOptions = new ExportOptionsSaveForWeb();
        sfwOptions.format = SaveDocumentType.JPEG;
        sfwOptions.includeProfile = true;
        sfwOptions.interlaced = 0;
        sfwOptions.optimized = true;
        sfwOptions.quality = 70;
        app.activeDocument.exportDocument(saveFileJPEG, ExportType.SAVEFORWEB, sfwOptions);
    }

    // alert('JPEG saved!');

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

 

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