3 Replies Latest reply on Nov 23, 2014 6:21 PM by ojodegato

    Batch Combining two files together into one


      hi everyone, first time poster here and i would greatly appreciate any help in my dilemma.

      im trying to batch process images into a single file using a script i got from the link below.

      Ok, my problem....merging two unique files batch Process


      my only issue im having is that i want the new batched file names to retain the foreground image file name.

      right now the batched file name is "file0001.psd", "file0002.psd", and so on.


      thanks for your help,



        • 1. Re: Batch Combining two files together into one
          ojodegato Level 1


          I have not tested the script you are using. I use a different Bridge script to combine two files into one.

          What kind of file save option do you require? psd? tiff?

          • 2. Re: Batch Combining two files together into one
            GregSma Level 1

            hi ojodegato

            thanks for your response,

            i prefer the batched files to be joeg,

            but i can always batch convert from psd to jpeg  afterwards.

            i wasn't aware bridge can also batch combine.

            can you show me how its done?


            • 3. Re: Batch Combining two files together into one
              ojodegato Level 1

              File Basics:

              The jpg file format does not support layer. You are better off creating your layer file as a PSD and then generate a jpg file.

              The PSD will be the master file for archiving and the JPG the working file.


              Save the script as batchStaks.jsx in the Bridge Start up script folder.

              Bridge >> Preferences >>Startup Scripts >> Reveal My Startup Scripts

              Restart Bridge.

              Create a Bridge stack

              Bridge >> Stacks >> Group as Stack

              Execute the batchStacks.jsx script from the Bridge Tools Menu

              Bridge >> Tools >> Batch Sctacks 2.2.0


              The script will save a layered PSD file in the same folder as the original file.

              The layered PSD file will retain the name of the image behind the thumbnail stack thumbnail.

              You need to experiment in Bridge with the image stack order to get the result you want.

              What I do to create layered file which retains the name of the thumbnail image stack is:

              I create a photoshop action which reverses the layer order.

              Then I have the script run the action while it creates the layered file.

              The result is a layered file that retains the filename of the thumbnail image stack. 


              The limitation is that the script dependes on the action file tho.


              #target bridge 



              <?xml version="1.0" encoding="UTF-8"?>

              <ScriptInfo xmlns:dc="http://purl.org/dc/elements/1.1/" xml:lang="en_US">

                   <dc:title>Batch Stack 2.2.0</dc:title>

                   <dc:description>The script loads Bridge Stacks as Photoshop layes and returns a layerd PSD file.</dc:description>







              if( BridgeTalk.appName == "bridge" ) {    

                  var batchStack = new MenuElement( "command","Batch Srtacks 2.2.0", "at the end of Tools" ); 



              batchStack .onSelect = function () {  

                  var stacks = app.document.stacks; 

                  var stackCount = stacks.length;


                  for(var s = 0;s<stackCount;s++){ 

                        var stackFiles = getStackFiles( stacks[s] ); 

                        if(stackFiles.length> 1){ 

                             var bt = new BridgeTalk; 

                             bt.target = "photoshop"; 

                             var myScript = ("var ftn = " + psRemote.toSource() + "; ftn("+stackFiles.toSource()+");"); 

                             bt.body = myScript; 





                  function getStackFiles( stack ){ 

                        var files = new Array(); 

                        for( var f = 0; f<stack.thumbnails.length;f++){ 



                       return files; 



                  function psRemote(stackFiles){ 


                      var thisDoc = open(File(stackFiles[0])); 

                      var Name = decodeURI(app.activeDocument.name).slice(0,-4); 

                      thisDoc.layers[0].name = decodeURI(Name);


                  for(var a = 1;a<stackFiles.length;a++){ 


                      Name = decodeURI(app.activeDocument.name).slice(0,-4); 



                      thisDoc.layers[0].name = Name;       



                      var psdOptions = new PhotoshopSaveOptions();

                      psdOptions.embedColorProfile = true;

                      psdOptions.alphaChannels = true;

                      psdOptions.layers = true;

                      psdOptions.spotColors = true;     


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

                      var path = app.activeDocument.path;

                      var saveFile = File(path + "/" + name );

                      app.activeDocument.saveAs(saveFile, psdOptions, true);