Skip to main content
Participant
May 22, 2025
Question

Is there a script to add the description as an editable panel alongside of name, keywords, etc?

  • May 22, 2025
  • 2 replies
  • 194 views

I'm experimenting with bridge as a potential tagging alternative to what we are already using. The big problem I'm facing is we cannot tag by changing the file name due to our need to edit with the clips while others on our team tag them. We currently tag in another software using what is essentially the description and keywords. If I could add the clip description to the panel where we could edit it just as if we were editing the clip title, that would pretty much solve the only big issue switching software would cause. I have absolutely zero idea of how to write scripts for this, so if anyone has one that would be a tremendous help!

2 replies

Legend
May 23, 2025

Here is a more fleshed-out script. Right-click your file(s) and select "Edit Description." The script reads dc:description from the first file, displays it in a window, and lets you edit and apply the changes to all selected files.

 

#target bridge
if(BridgeTalk.appName == 'bridge'){
    var descCmd = MenuElement.create('command', 'Edit Description...', 'after Thumbnail/Open', this.menuID); //add to Contextual menu
    }

descCmd.onSelect = function(){
    descMain();
    }

descMain = function(){
    try{
        var descThumbs = app.document.selections; //get selected thumbnails
        if(!descThumbs.length) return; //nothing selected
        var descr = '';
        if(!descThumbs[0].hasMetadata) return; //no metadata
        var descMeta = descThumbs[0].synchronousMetadata;
        var descXMP = new XMPMeta(descMeta.serialize());
        if(descXMP.doesPropertyExist(XMPConst.NS_DC, 'description')){
            descr = descMeta.read(XMPConst.NS_DC, 'description');
            descr = descr.toString();
            }
        else{
            descr = '';
            }
        descWindow = new Window ('palette', 'Edit Description', undefined);
        descPanel = descWindow.add('panel', undefined, '');
        descPanel.orientation = 'column';
        descPanel.alignChildren = ['left', 'top'];
        descPanel.lbl1 = descPanel.add('statictext', undefined, 'Description:');
        descPanel.lbl1.graphics.font = 'palette-bold';
        descPanel.txt1 = descPanel.add('edittext {justify:"left"}', undefined, '');
        descPanel.txt1.preferredSize = [350, 80];
        descPanel.txt1.text = descr;
        descPanel.grp1 = descPanel.add('group', undefined, '');
        descPanel.grp1.preferredSize = [350, 50];
        descPanel.grp1.orientation = 'row';
        descPanel.grp1.alignment = ['fill', 'fill'];
        descPanel.grp1.margins = [30, 20, 0, 0];
        descPanel.grp1.button1 = descPanel.grp1.add('button', undefined, 'Cancel', {name: 'cancel'});
        descPanel.grp1.button2 = descPanel.grp1.add('button', undefined, 'Apply Changes', {name: 'ok'});
        descPanel.grp1.button2.enabled = false;

        descPanel.txt1.onChanging = function(){
            descPanel.grp1.button2.enabled = true;
            }

        descPanel.grp1.button1.onClick = function(){
            descWindow.close();
            }

        descPanel.grp1.button2.onClick = function(){
            descr = descPanel.txt1.text;
            descWindow.close();
            for(var a in descThumbs){ //loop through thumbs
                if(!descThumbs[a].container){
                    try{
                        descMeta = descThumbs[a].synchronousMetadata;
                        descXMP = new XMPMeta(descMeta.serialize());
                        descXMP.deleteProperty(XMPConst.NS_DC, 'description');
                        descXMP.setLocalizedText(XMPConst.NS_DC, 'description', null, 'x-default', descr);
                        var descUpdatedPacket = descXMP.serialize(XMPConst.SERIALIZE_OMIT_PACKET_WRAPPER | XMPConst.SERIALIZE_USE_COMPACT_FORMAT);
                        descThumbs[a].metadata = new Metadata(descUpdatedPacket); //write to file
                        }
                    catch(e){
                        Window.alert(e + e.line);
                        }
                    }
                }
            }
        descWindow.layout.layout(true);
        descWindow.show();
        descPanel.txt1.active = true;
        }
    catch(e){
        Window.alert(e + e.line);
        }
    }

 

Participant
May 23, 2025

This is incredibly helpful, I'll try it out! Thank you so much

Legend
May 23, 2025

Feel free to modify or extend this as you want, this should work but is fairly barebones. Hopefully it gets you closer to what you need.

Legend
May 22, 2025

You can't add to the built-in panels.

 

You might be able to use the Custom Metadata Panel found here:

https://github.com/adobe-dmeservices/custom-metadata

 

Below is a sample script for writing text to the dc:description field.

#target bridge
if(BridgeTalk.appName == 'bridge'){
    var descltCmd = MenuElement.create('command', 'Edit Description...', 'after Thumbnail/Open', this.menuID); //add to Contextual menu
    }
descltCmd.onSelect = function(){
    descltMain();
    }

descltMain = function(){
    var descThumbs = app.document.selections; //get selected thumbnails
    if(!descThumbs.length) return; //nothing selected
    var descr = '';
    descr = Window.prompt('Enter new description');
    if(descr == null){
        return;
        }
    for(var a in descThumbs){ //loop through thumbs
        if(!descThumbs[a].container){
            try{
                var descMeta = descThumbs[a].synchronousMetadata;
                var descXMP = new XMPMeta(descMeta.serialize());
                descXMP.deleteProperty(XMPConst.NS_DC, 'description');
                descXMP.setLocalizedText(XMPConst.NS_DC, 'description', null, 'x-default', descr);
                var descUpdatedPacket = descXMP.serialize(XMPConst.SERIALIZE_OMIT_PACKET_WRAPPER | XMPConst.SERIALIZE_USE_COMPACT_FORMAT);
                descThumbs[a].metadata = new Metadata(descUpdatedPacket); //write to file
                }
            catch(e){
                alert(e + e.line);
                }
            }
        }
    }