Skip to main content
Inspiring
March 29, 2020
Question

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

  • March 29, 2020
  • 8 replies
  • 7023 views

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.

8 replies

rodrigounda
Known Participant
September 24, 2025

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

Inspiring
September 24, 2025

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

Stephen Marsh
Community Expert
Community Expert
March 31, 2020
Inspiring
April 6, 2020

My problem is solved.

 

Stephen Marsh
Community Expert
Community Expert
April 6, 2020

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?

Participating Frequently
March 30, 2020

Wrong account!

Inspiring
March 30, 2020

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

Stephen Marsh
Community Expert
Community Expert
March 29, 2020

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.

Inspiring
March 29, 2020

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.

Inspiring
March 29, 2020

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?

Stephen Marsh
Community Expert
Community Expert
March 29, 2020

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);}
    }
};

 

Participant
August 10, 2020

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

Stephen Marsh
Community Expert
Community Expert
August 10, 2020

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

Stephen Marsh
Community Expert
Community Expert
March 29, 2020

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);
         }
    }
}

 

Participant
July 15, 2022

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?

Stephen Marsh
Community Expert
Community Expert
March 29, 2020
Stephen Marsh
Community Expert
Community Expert
March 29, 2020

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?

Inspiring
March 29, 2020

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.

Inspiring
March 29, 2020

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.