• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Batch Renaming Issue with Milliseconds

Explorer ,
Sep 28, 2024 Sep 28, 2024

Copy link to clipboard

Copied

Hello Community,

filenames out of the camera are set as _DSC1.* _DSC2.*, _DSC3.* …

My Batch Renaming procedure includes MMSS to ensure right chronological sequence:

step31519705xkxe_0-1727523446877.png

(Another text line not shown, as last step to add model).

What I get is:

step31519705xkxe_1-1727523463146.png

So Milliseconds are reflected as 000 in the renaming procedure although they are included in the metadata: File info:

step31519705xkxe_2-1727523474500.png

 

How do I get this to work correctly? Result should be: 20240928_102028980_D750

These issues have been reported earlier Adobe Bridge Batch rename - issues to include mill... - Adobe Community - 12519842 but doesn’t seem to be fixed yet?

Thanks for your ideas!!

Martin

(Bridge 14.1, Windows 11)

TOPICS
Batch , Metadata , Problem or error

Views

1.5K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Oct 03, 2024 Oct 03, 2024

For what it's worth, here is the Bridge script to batch rename using milliseconds:

 

/*
Batch Rename to YYYYMMDD_HHMMSSMS_D750.jsx
v1.0 - 3rd October 2024, Stephen Marsh
https://community.adobe.com/t5/bridge-discussions/batch-renaming-issue-with-milliseconds/td-p/14886235

Rename from:

_DSC1.jpg
_DSC1.NEF

to:

YYYYMMDD_HHMMSSMS_D750.jpg
YYYYMMDD_HHMMSSMS_D750.NEF

With the MS or Millisecond value being the only unique part of the filename.

Note: Bridge 2024 fails to refresh, so refresh/F5 man
...

Votes

Translate

Translate
Community Expert ,
Sep 29, 2024 Sep 29, 2024

Copy link to clipboard

Copied

Offhand my suggestion would be to use another program such as the CLI ExifTool if the milliseconds are critical.

 

https://www.dyxum.com/dforum/metadata-for-milliseconds_topic138111.html

 

https://exiftool.org/forum/index.php?topic=15297.0

 

I don't have any images at hand that include millisecond metadata for testing.

 

Rather than using milliseconds, you could use a numerical sequence to avoid the rename clash (1) etc.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Sep 30, 2024 Sep 30, 2024

Copy link to clipboard

Copied

Yes, I tried this numerical sequence option, but doesn't work either. Bridge puts the files in upside down order:

step31519705xkxe_0-1727734944472.png

1 - 2024-09-28 10:20:28.98

2 - 2024-09-28 10:20:28.65

3 - 2024-09-28 10:20:28.49

(extracted from file info, origin).

This is why I'd like to add the millisec. Seems to be the only chance to get the correct order via sorting by file name, when HHMMSS are the same.

Thank you guys for your help. 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 30, 2024 Sep 30, 2024

Copy link to clipboard

Copied

Can you provide sample images containing millisecond metadata? They can be reduced in pixel size as it's only the intact metadata that is important for testing.

 

Batch Rename should use the sort order.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Oct 01, 2024 Oct 01, 2024

Copy link to clipboard

Copied

It seems to be really weird.

If using the numeric sequence as (last) step of the Batch Rename operation the resulting sequence order seems to be dependent on the sequence you select the files to be processed.

In other words:

1. These are the files out of the camera. As you can see in the thumbnail, I focused the left edge of the book and moved the camera to the right, shutter release in Continuous High

step31519705xkxe_0-1727801060275.png

2. Now shift + click to select 6510, and hold shift + arrow down to select 6511 and 6512 as well. All three are selected.

3. Batch Rename

step31519705xkxe_1-1727801345069.png

4. Result: correct sequence, first shot is placed first.

step31519705xkxe_2-1727801419473.png

5. Now different approach: shift + click to select 6512, shift + arrow up to select 6511 and 6510 as well

6. Identical Batch Rename procedure

7. Result: inverted sequence, i.e. first shot (book to the far right) placed last.

step31519705xkxe_3-1727802164393.png

Sorry, but this is strange, isn't it? Or else, what do I miss?

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 01, 2024 Oct 01, 2024

Copy link to clipboard

Copied

As you haven't supplied any samples, I'm still trying to find some with intact metadata for testing.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Oct 02, 2024 Oct 02, 2024

Copy link to clipboard

Copied

Hi Stepehn, sorry for delay. Files attached. Looked for some way to make them smaller without changing NEF-format, but didn't find.  

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Oct 02, 2024 Oct 02, 2024

Copy link to clipboard

Copied

6511

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 02, 2024 Oct 02, 2024

Copy link to clipboard

Copied

You can't email attachments to the forum, you need to use the website interface.

 

Just save a copy as JPEG, you can crop it or downsize it, as long as it has the original metadata it could be 1 x 1px in size.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Oct 02, 2024 Oct 02, 2024

Copy link to clipboard

Copied

Hi Stephen, I dropped the files on this website - perhaps too big. Now I uploaded the 3 files, downsized in JPG and original metadata embedded, on this forum's website in the drag&drop field. Hope this works. Thx.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 02, 2024 Oct 02, 2024

Copy link to clipboard

Copied

@step31519705xkxe 

 

Unlike earlier versions, Bridge 2024 (14.0.0.102) appears to be able to correctly rename using the milliseconds value!

 

milliseconds.png

 

P.S. For the sake of completeness, I'll post an ExifTool command tomorrow and look into a script for renaming for earlier versions of Bridge, it's bedtime now!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 02, 2024 Oct 02, 2024

Copy link to clipboard

Copied

Ha, it's buggy!

 

I quit Bridge 2024 after taking that screenshot, then tried in 2023 where it used 000, then went back to Bridge 2024 and it flaked out and used 000.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 02, 2024 Oct 02, 2024

Copy link to clipboard

Copied

Buggy? No way.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 02, 2024 Oct 02, 2024

Copy link to clipboard

Copied

quote

Buggy? No way.


By @Lumigraphics

 

I know, truly unbelievable! 

 

I used to wonder if Bridge would be any different if it was a paid product.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Oct 02, 2024 Oct 02, 2024

Copy link to clipboard

Copied

Hi Stephen, thx for reproducing this issue. Tricky one to detect.

Could you please try to reproduce the described sorting bug as well (pls see above: 1. to 7., select original files one after the other, one time starting from the top and arrow down, the other time starting from the bottom and arrow up, each time then batch rename the selected 3 files with a sequence number - and can you reproduce different results in sequencing?)

!!THX!!  

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Oct 02, 2024 Oct 02, 2024

Copy link to clipboard

Copied

And another follow up: I would say it's superbuggy!

Rename procedure, as you did, with the original JPGs, and same result as yours: millisec reflected.

step31519705xkxe_1-1727883228004.png

 

Same procedure with original NEFs: you get 000s and milliseconds are gone.

step31519705xkxe_2-1727883281187.png

 

 

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 02, 2024 Oct 02, 2024

Copy link to clipboard

Copied

You may need to use a script or EXIFTool to extract the millisecond data and write it to another XMP field where it can be used. I realize this just adds complexity but if its properly scripted can be fairly painless.

I have some data handled this way since I use Bridge for image processing in production and need things automated as much as possible.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Oct 02, 2024 Oct 02, 2024

Copy link to clipboard

Copied

Hi Lumigraphics, Hi Stephen,

 

yes, scripting could be a solution, hm, but sounds rather complex for my little expertise...

 

At the beginning of the story was my request to keep the correct order of  Continuous High shots after renaming, that couldn't be seperated via HHMMSS metadata. The idea was to solve that issue via adding millisec. This approach revealed the bug with the 000s, so no solution from there. Then the point appeared that it matters where you start selecting the files for renaming, top or bottom, to achieve correct order.

 

Now I figured out the following process to get what I want, lean enough and working for me:

1. Select the whole bunch of original NEF files in the directory to be renamed. Be sure not to select any single file prior to CTRL + A. Or either if you only want to select some files in the directory, be sure to select the one at the top (first shot of the series) and arrow down.

2. Batch rename (my pattern: yyyymmdd_hhmmss_cam.NEF). After that 90% of my files are correctly renamed and in good order. Few files look like yyyymmdd_hhmmss_cam (1).NEF, ... (2).NEF etc., when Bridge needs to additionally separate files.

3. One file out of the group doesn't have an additional number, which is the first one of the quick shots. Manually attach a (0) to this file.

4. 2nd Batch Rename procedure with a Regex String Substitution for this group of files only.
Regex Code: (Find) (\d{8})_(\d{6})_([A-Za-z0-9]+) \((\d+)\)  (Replace) $1_$2_$4_$3
ChatGPT created the code for me 🙂

5. Result: yyyymmdd_hhmmss_0_cam.NEF, yyyymmdd_hhmmss_1_cam.NEF, which brings this group of files in exact the right order when sorted by file name.

6. Remark: why not placing the counter at the end? Because I use manually attached counters at the end for duplicates when they are substantially edited (intense crop, change of format, etc.)

 

Works for me like a charm.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 02, 2024 Oct 02, 2024

Copy link to clipboard

Copied

@step31519705xkxe 

 

Glad you have a workable solution!

 

I'm still going to explore both ExifTool and scripting to see if the millisecond issue can be otherwise resolved (I'm like a dog with a bone, and I'm not done chewing this one!).

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 02, 2024 Oct 02, 2024

Copy link to clipboard

Copied

quote

P.S. For the sake of completeness, I'll post an ExifTool command tomorrow and look into a script for renaming for earlier versions of Bridge, it's bedtime now!

 

 

OK, I have come up with a workable ExifTool command. Work on duplicate files for safety, or change -filename to -testname until you are happy with the results.

 

  • These following command line interface examples are formatted for the Mac, Windows users would change the single straight quote marks ' in the code to double straight quote marks "
  • The commands would be input into Terminal.app on Mac or CMD.exe on Windows
  • The underline is there to visually indicate that there is a space after the last visible character. One would drag in the files or folder into the command windows to be recursively processed to complete the path and then press enter to run the command.
  • The sub-second/millisecond value is 2 digits, but it's easy enough to pad this out with a zero at the end to 3 digits

 

The results from the 3 test images are:

 

20241001_07283961_D750.jpg

20241001_07283976_D750.jpg

20241001_07283991_D750.jpg

 

Using two sequential regular expressions to delete all directory colon : separators and change all word spaces to underscore characters with a hard-coded camera model number '_D750' and a variable filename extension:

 

exiftool '-filename<${DateTimeOriginal;s/://g;s/ /_/g}${SubSecTimeOriginal}_D750.%e' -r 

 

____________

 

Rather than hard-code in the name of the Nikon D750 model, one can get the make/model metadata and regex to remove the make from 'NIKON D750' to leave the model 'D750':

 

exiftool '-filename<${DateTimeOriginal;s/://g;s/ /_/g}${SubSecTimeOriginal}_${model;s/(^.+ )(.+$)/$2/}.%e' -r 

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 02, 2024 Oct 02, 2024

Copy link to clipboard

Copied

This variation on the previous examples adds options to preserve file modification date/time, allow the original file attributes to be preservedpreserve the original filename:

 

exiftool -P -overwrite_original_in_place '-XMP-xmpMM:PreservedFileName<${filename;s/\.[^.]*$//}' -execute '-filename<${DateTimeOriginal;s/://g;s/ /_/g}${SubSecTimeOriginal}_${model;s/(^.+ )(.+$)/$2/}.%e' -common_args -r 

 

As this variation overwrites the original to add the preserved filename metadata, in addition to the renaming, it is best to work on copies of the originals until you are happy with the results.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 03, 2024 Oct 03, 2024

Copy link to clipboard

Copied

For what it's worth, here is the Bridge script to batch rename using milliseconds:

 

/*
Batch Rename to YYYYMMDD_HHMMSSMS_D750.jsx
v1.0 - 3rd October 2024, Stephen Marsh
https://community.adobe.com/t5/bridge-discussions/batch-renaming-issue-with-milliseconds/td-p/14886235

Rename from:

_DSC1.jpg
_DSC1.NEF

to:

YYYYMMDD_HHMMSSMS_D750.jpg
YYYYMMDD_HHMMSSMS_D750.NEF

With the MS or Millisecond value being the only unique part of the filename.

Note: Bridge 2024 fails to refresh, so refresh/F5 manually to see the renamed files!

*/

#target bridge

if (BridgeTalk.appName == "bridge") {
   batchRename = new MenuElement("command", "Batch Rename to YYYYMMDD_HHMMSSMS_D750", "at the end of tools");
}

batchRename.onSelect = function () {
   var sels = app.document.selections;
   for (var z = 0; z < sels.length; z++) {
      var thumb = sels[z];
      var selectedFile = thumb.spec;
      var md = new Thumbnail(selectedFile).synchronousMetadata;
      md.namespace = "http://ns.adobe.com/xap/1.0/";
      var cd = md.CreateDate;
      // 2024-10-01T07:28:39.91
      var dateTime = cd.replace(/(^\d{4})(?:-)(\d{2})(?:-)(\d{2})(?:T)(\d{2})(?::)(\d{2})(?::)(\d{2})(?:\.)(\d{2})/, '$1$2$3_$4$5$6$7');
      var ext = selectedFile.name.replace(/(^.+)(\.[^\.]+$)/, '$2');
      //alert(dateTime + "_D750" + ext);
      File(selectedFile).rename(dateTime + "_D750" + ext);
   }
   alert("Custom Rename Completed!" + "\r" + "Manually select View > Refresh or press F5 in Bridge 2024!");
   app.refresh();
}

 

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Oct 03, 2024 Oct 03, 2024

Copy link to clipboard

Copied

This one works perfectly (Bridge 14.1.). THX!! 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 04, 2024 Oct 04, 2024

Copy link to clipboard

Copied

This variation on the previous script uses a variable model name, rather than hard-coding it in. It uses the last string of characters after the last word space character in the make/model metadata, i.e.:

 

NIKON D750

to

D750

 

Note: Updated to a 1.1 version to automatically preserve the original filename metadata before renaming.

 

/*

Batch Rename to YYYYMMDD_HHMMSSMS_MODEL.jsx

v1.0 - 5th October 2024, Stephen Marsh:
A variation on the previous script, swapping the hard-coded model for a variable, using a regular expression, i.e.: "NIKON D750" to "D750"

v1.1 - 5th October 2024, Stephen Marsh:
Added preserve current filename in metadata before renaming

https://community.adobe.com/t5/bridge-discussions/batch-renaming-issue-with-milliseconds/td-p/14886235

Rename from:

_DSC1.jpg
_DSC1.NEF

to:

YYYYMMDD_HHMMSSMS_MODEL.jpg
YYYYMMDD_HHMMSSMS_MODEL.NEF

With the MS or Millisecond value being the only unique part of the filename.

Note: Bridge 2024 fails to refresh, so refresh/F5 manually to see the renamed files!

*/

#target bridge

if (BridgeTalk.appName == "bridge") {
   batchRename = new MenuElement("command", "Batch Rename to YYYYMMDD_HHMMSSMS_MODEL", "at the end of tools");
}

batchRename.onSelect = function () {
   var sels = app.document.selections;
   for (var z = 0; z < sels.length; z++) {

      var thumb = sels[z];
      var selectedFile = thumb.spec;
      var md = new Thumbnail(selectedFile).synchronousMetadata;
      var md2 = new Thumbnail(selectedFile).synchronousMetadata;
      var md3 = new Thumbnail(selectedFile).synchronousMetadata;
      md.namespace = "http://ns.adobe.com/xap/1.0/";
      md2.namespace = "http://ns.adobe.com/tiff/1.0/";
      md3.namespace = "http://ns.adobe.com/xap/1.0/mm/";

      // Get the selected filename without extension
      var Name = decodeURI(selectedFile.name).replace(/\.[^\.]+$/, '');
      
      // Add the filename to the preserved filename metadata
      md3.PreservedFileName = '';
      md3.PreservedFileName = Name;
      
      // Get the make/model metadata (i.e.: NIKON D750)
      var makeModel = md2.Model;
      
      // Remove the make to leave the model (i.e.: D750)
      var model = makeModel.replace(/(^.+ )(.+$)/, '$2');
      
      // Create date (i.e.: 2024-10-01T07:28:39.91)
      var cd = md.CreateDate;
      
      // Reformat the create date/time to YYYYMMDD_HHMMSSMS
      var dateTime = cd.replace(/(^\d{4})(?:-)(\d{2})(?:-)(\d{2})(?:T)(\d{2})(?::)(\d{2})(?::)(\d{2})(?:\.)(\d{2})/, '$1$2$3_$4$5$6$7');
      
      // Get the filename extension
      var ext = selectedFile.name.replace(/(^.+)(\.[^\.]+$)/, '$2');
      
      // Rename using a hard-coded, static camera model name
      //File(selectedFile).rename(dateTime + "_D750" + ext);
      
      // Rename using a variable camera model name
      File(selectedFile).rename(dateTime + "_" + model + ext);
   }
   app.refresh();
}

 

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Oct 02, 2024 Oct 02, 2024

Copy link to clipboard

Copied

6512

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines