Skip to main content
Inspiring
Mar 29, 2020 4:36 PM UTC
Question

Set Filename to Metadata Bridge script John Beardsworth in Bridge 2020 not working

I have previously used John Beardsworth's script Set Filename to Metadata which put the file name in the Document Title in File Information.  In Bridge 2020 under Tools, it is not showing up.  I can see the script in the BridgeStartup list.  Is just isn't available.  I just discovered this as I haven't used Photoshop for a while.

Has anyone else experienced this problem?

I have emailed John about this.

Any help with this would be greatly appreciated.  It is a great little script.

46 replies

rodrigounda
Known Participant
Sep 24, 2025 4:06 AM UTC

best pack of scripts.
do you know if there is a updated version?

Translate
Inspiring
Sep 24, 2025 10:39 AM UTC

Hi,

Yes, there is.  Check out John Beardsworth, Bridge filename to metadata.  I am using the script from David in Bridge, and it works.  

Lynnea

Translate
Stephen Marsh
Community Expert
Community Expert
Mar 31, 2020 9:38 PM UTC

Also here:

 

Updated Script Utility Pack 2.1

Translate
Inspiring
Apr 6, 2020 11:43 AM UTC

My problem is solved.

 

Translate
Stephen Marsh
Community Expert
Community Expert
Apr 6, 2020 1:31 PM UTC

So it looks like I'll never get any sleep, not knowing if the modifications that I made to one of the alternative scripts worked for you or not, as the original issue has been solved. :]

 

Is there a correct answer to be found in this thread?

Translate
Participating Frequently
Mar 30, 2020 8:42 PM UTC

Wrong account!

Translate
Inspiring
Mar 30, 2020 8:45 PM UTC

I got in touch with David Converse.  He kindly fixed John's script.  It works, so my problem is solved.

 

Thanks for all your effort. 

 

Lynnea

Translate
Stephen Marsh
Community Expert
Community Expert
Mar 29, 2020 7:18 PM UTC

And for completeness, here is the ExifTool command to copy the filename to the Title metadata field, without the extension:

 

exiftool -overwrite_original '-title<${filename;s/\.[^.]*$//}' 'fileORdirectory'

 

Note: This command is formatted for the Mac, Win users would replace the single straight quotes with double straight quotes. The 'fileORdirectory' would be replaced with the full file system path to the file or folder to process. Further arguments can be added to recurse into all sub-directories under the top level folder, include or exclude specific file types or folders etc.

Translate
Inspiring
Mar 29, 2020 8:24 PM UTC

OK. What you show for 2019 is exactly what I had.  But, I do not have it with 2020. 

Also, I just simply cannot figure out how to install the first alternative you list.  I have printed out the help pdf for the Utility Script Pack 2.1 for Bridge.  I have been able to download the utility pack, but I simply cannot figure out how to install it.  I did a copy and paste into the startup script fold for Bridge 2020, but nothing shows up.   I closed Bridge, restarted it, and did not see the start script in the preferences.

 

I must be doing something wrong.

Translate
Inspiring
Mar 29, 2020 9:00 PM UTC

I was finally able to figure out how to install the script.  I was able to set the file name to the document title.

Is there any way to include the file extension?

Translate
Stephen Marsh
Community Expert
Community Expert
Mar 29, 2020 7:10 PM UTC

And another, modified from adding the filename to description:

 

//forums.adobe.com/message/10061534#10061534
//forums.adobe.com/message/3595421#3595421
#target bridge
   if( BridgeTalk.appName == "bridge" ) {
fileToDesc = MenuElement.create("command", "Add FileName to Title", "at the end of Tools");
}
fileToDesc.onSelect  = function () {
var thumbs = app.document.selections;
if (ExternalObject.AdobeXMPScript == undefined)  ExternalObject.AdobeXMPScript = new ExternalObject("lib:AdobeXMPScript");
for(var a =0;a<thumbs.length;a++){
var selectedFile =  new Thumbnail(thumbs[a]);
app.synchronousMode = true;
var xmp = new XMPMeta(selectedFile.synchronousMetadata.serialize());
var Desc = getArrayItems(XMPConst.NS_DC, "title");
if(Desc != "") Desc+= ";";
xmp.deleteProperty(XMPConst.NS_DC, "title");
xmp.setLocalizedText( XMPConst.NS_DC, "title", null, "x-default", Desc +=  decodeURI(selectedFile.spec.name).replace(/\..+$/,""));
var newPacket = xmp.serialize(XMPConst.SERIALIZE_USE_COMPACT_FORMAT);
selectedFile.metadata = new Metadata(newPacket);
    }
ExternalObject.AdobeXMPScript.unload();
ExternalObject.AdobeXMPScript = undefined;
function getArrayItems(ns, prop){
var arrItem=[];
try{
var items = xmp.countArrayItems(ns, prop);
for(var i = 1;i <= items;i++){
arrItem.push(xmp.getArrayItem(ns, prop, i));
}
return arrItem.toString();
}catch(e){alert(e +" Line: "+ e.line);}
    }
};

 

Translate
Participant
Aug 10, 2020 4:43 PM UTC

How do I go about adding this filename to description script? Do I edit the FilenametoTitle script or create a new one? 

Translate
Stephen Marsh
Community Expert
Community Expert
Aug 10, 2020 8:33 PM UTC

You can edit it if you like. I'll post the original script code for description as this is for title.

Translate
Stephen Marsh
Community Expert
Community Expert
Mar 29, 2020 7:00 PM UTC

Another option:

 

CS5 Filename to Title Script

 

 

//imagesimple.wordpress.com/2011/08/24/cs5-filename-to-title-script/
#target bridge
   if( BridgeTalk.appName == "bridge" ) {
FT = MenuElement.create("command", "Add FileName to Title", "at the end of Tools");
}
FT.onSelect = function () {
   AddFilenameToTitle();
   }
function AddFilenameToTitle(){
var thumbs = app.document.selections;
if(!thumbs.length) return;
if (ExternalObject.AdobeXMPScript == undefined)  ExternalObject.AdobeXMPScript = new
ExternalObject("lib:AdobeXMPScript");
for(var a in thumbs){
var selectedFile = thumbs[a].spec;
var Title = decodeURI(selectedFile.name).replace(/\.[^\.]+$/, '')
      var myXmpFile = new XMPFile( selectedFile.fsName, XMPConst.UNKNOWN,
XMPConst.OPEN_FOR_UPDATE);
  var myXmp = myXmpFile.getXMP();
        myXmp.deleteProperty(XMPConst.NS_DC, "title");
        myXmp.appendArrayItem(XMPConst.NS_DC, "title", Title, 0,
XMPConst.ALIAS_TO_ALT_TEXT);
        myXmp.setQualifier(XMPConst.NS_DC, "title[1]",
"http://www.w3.org/XML/1998/namespace", "lang", "x-default");
        if (myXmpFile.canPutXMP(myXmp)) {
        myXmpFile.putXMP(myXmp);
         myXmpFile.closeFile(XMPConst.CLOSE_UPDATE_SAFELY);
         }
    }
}

 

Translate
Participant
Jul 15, 2022 11:36 PM UTC

When I use this it works great, but it duplicates the first file in my selection and I cannot seem to delete this file! Any ideas?

Translate
Stephen Marsh
Community Expert
Community Expert
Mar 29, 2020 6:57 PM UTC
Stephen Marsh
Community Expert
Community Expert
Mar 29, 2020 5:26 PM UTC

Can you share the link to the script download or paste the code?

 

Sometimes the script menu name is not the same as the script file. Most scripts are under the tools menu, however some are contextual right click.

 

What metadata field/s is the filename being written to?

Translate
Inspiring
Mar 29, 2020 5:36 PM UTC

Set filename to metadata CS2-CS5.zip

The script copies the image file name to the IPTC Document Title.

 

I tried resetting bridge preferences, but that did not fix the problem.

 

Right click does not show the option.

Translate
Inspiring
Mar 29, 2020 6:00 PM UTC

John has replied with the answer that something broke the script.  I've asked him if he is possibly thinking about fixing the script.

It was a very simple and very effective tool which I have used for many years now, so I would really hate to lose it.

Translate