5 Replies Latest reply on Mar 4, 2014 3:16 PM by jstrawn

    How to do automated sequential rename upon duplication of stills?

    jstrawn Adobe Employee

      I've a series of images (dpx, by chance) with nemase like: A002_C009_0216BB.0000000.dpx, .....000001, .....000001, all the way through A002_C009_0216BB.0000377.dpx

       

      I want to duplicate the whole set but rename the dup set to start at  .....000378 and continue sequentially. I need to repeat this process until I have at least a coupel thousanf images. I don't mind the repeated frames, that part is of no consequence for what I'm doing. I just need to get al the names sequential from .....000001 to .....002000+ or whatever. Suggestions on how to automate sequencial rename upon duplication?

        • 1. Re: How to do automated sequential rename upon duplication of stills?
          Chuck Uebele Adobe Community Professional & MVP

          It looks like it would be best to use a script.  You could copy the file to another folder then rename that file.  since it looks like you're using a "." to separate the file number, you can split the name up into an array based on the "."  then you change the file number ending from a string to a number and add it to 1000001.  Then turn it back into a string and chop off the first 1.  I think it's harder to explain that actually writing the script.

          • 2. Re: How to do automated sequential rename upon duplication of stills?
            Curt Y Level 7

            Can't say I completely understand, but if the name is the same but just the sequetial number is added Bridge can do that and start at number you indicate.

             

            Also, little concerned with the file name.  In some programs anything after the first dot is considered an extension.  So program will look for extension .000037 to open program rather than .dpx in last example.

            • 3. Re: How to do automated sequential rename upon duplication of stills?
              jstrawn Adobe Employee

              Yes I was thinkng Bridge too. (script would be easy... if only I knew the first thing about writing and running it by myself... sort of like how easy it is to get to my house... for ME )

               

               

              @ Curt, let me clarify by scaling it down:

              • Say I have files 000.dpx, 001,jpg, 002.dpx
              • I want to end up with 1000 sequentially named files.
              • I don't care what the cotnents are but I don't want to use the same image for each one either. A cycle of a few (hundred) unique images (which is what I actually have) is fine.
              • I can copy and paste files 000-002 into new folders, dup those and redup them until i have 1000 files, but at some point I need to make them all live in on folder and be names 000.dpx-999.dpx sequentially

               

              I know Bridge can do this, but not sure how.

              • 4. Re: How to do automated sequential rename upon duplication of stills?
                Chuck Uebele Adobe Community Professional & MVP

                I would agree with Curt about the "."  Here's a very quick script that I wrote to show what can be done.  I'm on a PC, so not sure how this will work on a Mac.  You put in the folder name of your source images at for "sFolder," and where you want them copied at "dFolder."  This copy and renumber your files to the copy folder starting at 378.  if you want to run it again, you would have to change the number at line 11.  This will only work with the file name structure you posted in this thread.  But it will give you an idea how it can be done.

                 

                #target photoshop

                 

                var sFolder = new Folder ('/c/Images/test/');

                var dFolder = new Folder ('/c/Images/test/copied/');

                var fileList = sFolder.getFiles();

                 

                for (var i = 0;i<fileList.length;i++){

                      var fileName = fileList[i].name;

                      var mainName = fileName.split('.')[0];

                      var fileNum = fileName.split('.')[1];

                      var newFileNum = Number(fileNum) + 1000378

                      var newName = mainName + '.' + newFileNum.toString().substr (1, 6)

                      var theFile = new File( fileList[i])

                      theFile.copy(dFolder + '/' + newName + fileName.split('.')[2])

                      };

                • 5. Re: How to do automated sequential rename upon duplication of stills?
                  jstrawn Adobe Employee

                  @ csue...: Intersting... yeah, I'm on mac and It will be time consuming to ge tthat working on there as is. Thanks for the fforts though.

                   

                  @ Curt: Don't worry about the file names (I appreciate your concern though).. they are named that way for a specific reason and the app I'm using them (PrPro) handles them fine.