-
1. Re: Batch Rename - Two File Formats with Same Name
Paul Riggott Jan 4, 2012 3:14 PM (in response to MartinKain)Most things are possible and so is this..
Make sure you do a test first by copying the files to a temp folder!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
First copy the script below and paste it into ExtendScript Toolkit (this gets installed with Photoshop)
#target bridge var sels = app.document.selections; for(var a in sels){ var f = decodeURI(sels[a].spec.name); var newName = "Picture 2011 - "+ zeroPad((f.match(/\d{4}/)[0]-1267).toString(),4)+ f.match(/\....$/); sels[a].spec.rename(newName); } function zeroPad(n, s) { n = n.toString(); while (n.length < s) n = '0' + n; return n; }Now open Bridge and select the files you want to rename, then run the above script from ExtendScript Toolkit.
-
2. Re: Batch Rename - Two File Formats with Same Name
RWSP Jan 5, 2012 7:30 AM (in response to MartinKain)What is the problem that you are experiencing? I have successfully batch-renamed in Bridge files with the same file name and different types (extensions). I just tried a test - two image files with same file name in a test folder: one a .cr2, the other a .jpg. The .cr2 had a sidecar .xmp file (same file name) so there are three files in the directory. I selected the two files in Bridge, performed a batch rename from _mg.3333 to 1234.3333. Bridge correctly displayed rename in its Preview (bottom of batch rename panel), and all three files were successfully renamed.
-
3. Re: Batch Rename - Two File Formats with Same Name
Paul Riggott Jan 5, 2012 8:02 AM (in response to RWSP)You can't do this with the batch rename as maths and zero padding is required to produce the target filename.
The convention required ..
IMG_1268.CR2 -> Picture 2011 - 0001.CR2
IMG_1268.JPG -> Picture 2011 - 0001.JPG
IMG_1269.CR2 -> Picture 2011 - 0002.CR2
IMG_1269.JPG -> Picture 2011 - 0002.JPG
So the renaming needs to subtract 1267 from the number in the orignal document, hence the script above.
-
4. Re: Batch Rename - Two File Formats with Same Name
RWSP Jan 5, 2012 8:11 AM (in response to Paul Riggott)That would explain a difference. In my renaming I'm using only string substitution, not appending sequence numbers.



