Skip to main content
Participant
April 7, 2025
Answered

Change filenames to Title Case

  • April 7, 2025
  • 4 replies
  • 457 views

I'm struggling to change filename to Title Case for yearbook photos in Bridge. 

Is there a script I can use?

Correct answer Stephen Marsh

@Ethereal_personality98BC 

 

I wrote a script for this, I'll post it when I'm in front of a computer.

 

EDIT: Here you go. Note that special handling of Irish and Scottish and other names is required and is beyond the scope of this script.

 

https://community.adobe.com/t5/bridge-discussions/script-to-batch-rename-as-title-case/td-p/14319096

 

/*
Rename to Title Case.jsx
v1.0 - 26th December 2023, Stephen Marsh
https://community.adobe.com/t5/bridge-discussions/script-to-batch-rename-as-title-case/td-p/14319096
*/

#target bridge

if (BridgeTalk.appName == "bridge") {
   var titleCase = new MenuElement("command", "Rename to Title Case", "at the end of Tools");
}

titleCase.onSelect = function () {
   var theFiles = app.document.selectionsLength;
   for (var a = 0; a < theFiles; a++) {
      var selsName = decodeURI(app.document.selections[a].spec.name.replace(/\.[^\.]+$/, ''));
      var selsExt = decodeURI(app.document.selections[a].spec.name.replace(/(^.+)(\.[^\.]+$)/, '$2'));
      app.document.selections[a].name = toTitleCase(selsName) + selsExt;
   }

   function toTitleCase(theText) {
      var theText = theText.toLowerCase().split(' ');
      for (var i = 0; i < theText.length; i++) {
         theText[i] = theText[i].charAt(0).toUpperCase() + theText[i].slice(1);
      }
      return theText.join(' ');
   }

}

 

  1. Copy the code text to the clipboard
  2. Open a new blank file in a plain-text editor (not in a word processor)
  3. Paste the code in
  4. Save as a plain text format file – .txt
  5. Rename the saved file extension from .txt to .jsx
  6. Install the .jsx file (see below)

 

Look for the instructions for Bridge:

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

4 replies

Stephen Marsh
Community Expert
Community Expert
April 9, 2025

@Ethereal_personality98BC 

 

Did my script help?

Participant
April 12, 2025

Hi There yes it did thank you, took me some time but got it working. 

Stephen Marsh
Community Expert
Community Expert
April 12, 2025
quote

Hi There yes it did thank you, took me some time but got it working. 


By @Ethereal_personality98BC


Do my instructions and link at the end of the script need revision?

Stephen Marsh
Community Expert
Community Expert
April 7, 2025

Both Mac and Windows OS have a native command-line feature for this. It is easy enough to set this up in a spreadsheet using formula such as =PROPER() and =CONCATENATE (I have used LibreOffice in the following screenshot as it allows Regular Expression based formulas which aren't available in Excel, however, this was only to handle mixed file extensions).

 

 

Original names on the left, new names on the right. The command will be copied and pasted into Terminal.app or CMD.exe, running the command from the same location as the image files if using relative names rather than full absolute paths.

 

Mac (Terminal.app):

 

mv 'FIRST NAME.jpg' 'First Name.jpg'
mv 'second name.jpg' 'Second Name.jpg'

 

Win (CMD.exe):

 

ren "FIRST NAME.jpg" "First Name.jpg"
ren "second name.jpg" "Second Name.jpg"

 

Notice how similar the two methods are. Ensure that Mac single straight quotes and Win double straight quotes don't get reformatted.

Stephen Marsh
Community Expert
Stephen MarshCommunity ExpertCorrect answer
Community Expert
April 7, 2025

@Ethereal_personality98BC 

 

I wrote a script for this, I'll post it when I'm in front of a computer.

 

EDIT: Here you go. Note that special handling of Irish and Scottish and other names is required and is beyond the scope of this script.

 

https://community.adobe.com/t5/bridge-discussions/script-to-batch-rename-as-title-case/td-p/14319096

 

/*
Rename to Title Case.jsx
v1.0 - 26th December 2023, Stephen Marsh
https://community.adobe.com/t5/bridge-discussions/script-to-batch-rename-as-title-case/td-p/14319096
*/

#target bridge

if (BridgeTalk.appName == "bridge") {
   var titleCase = new MenuElement("command", "Rename to Title Case", "at the end of Tools");
}

titleCase.onSelect = function () {
   var theFiles = app.document.selectionsLength;
   for (var a = 0; a < theFiles; a++) {
      var selsName = decodeURI(app.document.selections[a].spec.name.replace(/\.[^\.]+$/, ''));
      var selsExt = decodeURI(app.document.selections[a].spec.name.replace(/(^.+)(\.[^\.]+$)/, '$2'));
      app.document.selections[a].name = toTitleCase(selsName) + selsExt;
   }

   function toTitleCase(theText) {
      var theText = theText.toLowerCase().split(' ');
      for (var i = 0; i < theText.length; i++) {
         theText[i] = theText[i].charAt(0).toUpperCase() + theText[i].slice(1);
      }
      return theText.join(' ');
   }

}

 

  1. Copy the code text to the clipboard
  2. Open a new blank file in a plain-text editor (not in a word processor)
  3. Paste the code in
  4. Save as a plain text format file – .txt
  5. Rename the saved file extension from .txt to .jsx
  6. Install the .jsx file (see below)

 

Look for the instructions for Bridge:

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

Legend
April 7, 2025

Bridge does not have this built in, you'd need to write a script.

 

However, both platforms have functionality that can be set up. On Windows, Power Rename (part of Powertoys) can do title case renaming. On Mac, an Automator action can handle this.

 

https://learn.microsoft.com/en-us/windows/powertoys/

https://support.apple.com/guide/automator/welcome/mac