0

So I'm trying to save a bunch of images that I've edited with added adjustments (exposure, colour lookup, level, brightness).

I know the method for this is File >> Scripts >> Export layers to files

BUT when I do that, it doesn't save the images WITH the added adjustments, just the original image itself.

Please help me, I have about 50 images to save individually with the adjustments and it's been time consuming so far.

enter image description here

ALSO, is there a way where I can save the Adjustment presets and migrate it over to Lightroom 4?

Thanks so much!!!!!!!

0

3 Answers 3

5

Here's a script that will do something like that:

Export Layers Inside Selected Group.jsx

enter image description here

Script usage:

Select a group that contains the layers you wish to export and run the script.

You may want to save before running the script, as it will leave all processed layers invisible.

The way it works:

  1. First it hides all the top level layers within the selected group
  2. One by one:
    1. Shows layer
    2. Saves
    3. Hides layer
    4. Moves to next layer and loops step #2

Code below, incase the gist is ever down:

// Name: Export Layers Inside Selected Group.jsx
// Description: Photoshop script that separately saves top level layers inside the selected group.
// https://gist.github.com/joonaspaakko/013a223e94ba0fb9a2a0

#target photoshop

try {
    var doc = app.activeDocument;
    var docName = doc.name.split('.')[0];
}
catch (e) {
    alert( 'Open a document first...' );
}

function init() {

    var savefiles;

    dlg.g.saveAs.minimumSize.width = 463;
    dlg.btns.minimumSize.height = 142;


    dlg.btns.save.onClick = function(){
       savefiles = true;
       dlg.close();
       return savefiles;
    };

    dlg.show();

    if ( savefiles ){

        var getDestination = Folder.selectDialog( 'Select destination folder...', doc.saved ? doc.path : '' );
        var group = doc.activeLayer;
        var groupLength = group.layers.length;

        for( var i = 0 ; i < groupLength; i++ ){
            group.layers[i].visible = false;
        }

        for( var i = 0 ; i < groupLength; i++ ){

            var layer = group.layers[ i ];
            var layerIndex = i+1;

            layer.visible = true;

            save.file( dlg, doc, getDestination, layerIndex );

            layer.visible = false;

        }

        alert('Files Saved!');

    }

}

var save = {
    file: function( dlg, doc, getDestination, layerIndex ) {

        var saveOptions = {};
        var formats = ["psd", "pdf", "png", "jpg", "tiff"];

        for ( var i=0; i < formats.length; i++ ) {
            if ( dlg.g.saveAs[ formats[i] ].value ) {

                var fileformat = formats[i];

                var path = getDestination + "/" + fileformat;

                makeFolder( path );

                doc.saveAs( File( path + "/" + dlg.g.filename.filename.text + layerIndex ), save[fileformat](), true );

            }
        }

    },
    psd: function() {

        var psd_saveOpts = new PhotoshopSaveOptions();

        psd_saveOpts.layers = true;
        psd_saveOpts.embedColorProfile = true;
        psd_saveOpts.annotations = true;
        psd_saveOpts.alphaChannels = true;

        return psd_saveOpts;

    },
    pdf: function() {

        var presetName = '[High Quality Print]';

        var pdf_SaveOpts = new PDFSaveOptions();

        pdf_SaveOpts.pDFPreset = presetName;

        return pdf_SaveOpts;

    },
    jpg: function() {

        var jpg_SaveOpts = new JPEGSaveOptions();

        jpg_SaveOpts.matte = MatteType.WHITE;
        jpg_SaveOpts.quality = 10;
        jpg_SaveOpts.formatOptions.STANDARDBASELINE;

        return jpg_SaveOpts;

    },
    png: function() {

        var png_SaveOpts = new PNGSaveOptions();

        png_SaveOpts.compression = 9;
        png_SaveOpts.interlaced = false;

        return png_SaveOpts;

    },
    tiff: function() {

        var tiff_SaveOpts = new TiffSaveOptions();

        tiff_SaveOpts.alphaChannels = true;
        tiff_SaveOpts.annotations = true;
        tiff_SaveOpts.imageCompression = TIFFEncoding.JPEG;
        tiff_SaveOpts.interleaveChannels = true;
        tiff_SaveOpts.jpegQuality = 10;
        tiff_SaveOpts.layers = true;
        tiff_SaveOpts.layerCompression = LayerCompression.ZIP;
        tiff_SaveOpts.transparency = true;

        return tiff_SaveOpts;

    }
};

// Prepare dialog...
var dlg = new Window("dialog {  \
    text: 'Export layers inside the selected group', \
    alignChildren:['left','center'], \
    orientation: 'row', \
    g: Group { \
        orientation:'column', \
        alignChildren: ['left','center'], \
        filename: Panel { \
            orientation:'column', \
            alignChildren: ['left','top'], \
            filename_text: StaticText { alignment:'left', text: 'Filename ( Incremental numbers added automatically ): '}, \
            filename: EditText { alignment:'left', preferredSize: [430,20], text: '"+ docName +"', active: true },  \
        }, \
        saveAs: Panel { \
            margins: 20, \
            spacing: 20, \
            orientation: 'row', \
            alignChildren: ['left','top'], \
            saveAs_txt: StaticText { text: 'Save as: '}, \
            jpg: Checkbox { text: 'jpg', value: true }, \
            psd: Checkbox { text: 'psd', value: false }, \
            pdf: Checkbox { text: 'pdf', value: false }, \
            png: Checkbox { text: 'png', value: false }, \
            tiff: Checkbox { text: 'tiff', value: false } \
        } \
    }, \
    btns: Panel { \
        margins: 20, \
        spacing: 20, \
        orientation: 'column',  \
        alignment: ['right','top'], \
        save: Button { text: 'Save', properties:{ name: 'ok' }, preferredSize:[88, 24] }, \
        cancel: Button { text: 'Cancel', properties:{ name: 'cancel' }, preferredSize:[88, 24] }, \
    } \
}");

function makeFolder( path ) {

    var newFolder = Folder( path );
    if( !newFolder.exists ) newFolder.create();

}

if ( app.documents.length > 0 ) {
    if ( app.activeDocument.activeLayer.layers ) {

            init();

    }
    else {
        alert( "Error: \nSelect a parent group of the layers you want to export.")
    }
}
8
  • @kyle buckner You might benefit from this as well.
    – Joonas
    Sep 8, 2014 at 11:09
  • I have tested your script on Photoshop CC 2016 and it is not working.
    – Duck
    Dec 1, 2015 at 5:00
  • @SpaceDog It was working for me. Although it was difficult to use. It could be that you didn't use it correctly or misunderstood what the script was supposed to do. I won't deny that it was poorly written, which is why I rewrote it to be a bit more flexible. Updated the answer.
    – Joonas
    Dec 1, 2015 at 13:55
  • I have 100 groups at the first level. Each group is a "layer" that I am trying to save. The script saves nothing.
    – Duck
    Dec 1, 2015 at 16:30
  • @SpaceDog Mind linking to that file (dropbox) or a dummy file that has similar structure and the same problem?
    – Joonas
    Dec 1, 2015 at 18:34
2

Photoshop's Actions functionality let's you record repetitive tasks. They can require some experimentation to get right, but I think in your particular case, it should be straight-forward.

Start with the layer visibility set exactly as you have it in your screen shot, and also with the same layer selected. Open up the Actions panel, and record a new action:

  1. From the Actions panel fly-out menu, choose "Insert Menu Item…". A dialog appears waiting for you to choose a menu item. Choose File menu > Save As. Click OK. Note you're only recording an action here, so you won't be saving anything yet.

  2. Hide the current layer.

  3. Select backward layer, using the keyboard shortcut Option (or Alt) + [.

  4. Press Stop recording on the Actions panel.

What you now have is an action that you can play that will automate the process of saving the file with it's current layer visibility settings, then turning off the current layer, and selecting the layer beneath, at which point you play the action again. Setting a keyboard shortcut for the action can also make it less tedious.

0

Your best bet is probably to record an action. The way I'd go about that is to record the adjustments you want to applied to your layers, either through "Image > Adjustments" or via adjustment layers. Then you should simply have to select your layers and play back the action. As long as it's set up right from the start that is, might take a bit of trail and error.

Heck, you might even be able to get the action to select the adjacent layer and start all over until it runs out of layers to run on. It should be possible

Not the answer you're looking for? Browse other questions tagged or ask your own question.