13 Replies Latest reply: Sep 8, 2013 2:36 PM by Sverk RSS

    How append to group metadata "Description"?

    Sverk Community Member

      I put this one in General Discussion first but it should be here of course:

       

      Hi,

      I'm using Photoshop CS6 with Bridge.

      Working a lot with documentary images, the Description metadata field is crucial for saving valuable info pertaining to the images, often quite a lot of text.  Bridge is useful -- but not as useful as I'd need.

      Very often I want to append to the Description for a group of images, and that works nice -- but ONLY if that field is empty in all the fields.

       

      And that is typically not the case.  I keep coming back with more info to add, but often not to the same selection of images.  Thus if I try selecting them I get "(Multiple values)" in the field.

      And if I type something in it REPLACES all the various existing content in the image files -- very bad loss of important data results.

       

      Thus, what I'd need is a way to APPEND text to the Description field contents for a selection of images.

      Is there some way in Bridge that I have overlooked?

      Or is there any plugin or auxiliary program that could be used for this?

       

      Help please!

      Sverker

        • 1. Re: How append to group metadata "Description"?
          Sverk Community Member

          I spotted  a typo:

          Should be:

          Very often I want to append to the Description for a group of images, and that works nice -- but ONLY if that field is empty in all the selected RECORDS.

          • 2. Re: How append to group metadata "Description"?
            Philip Cord Community Member

            You could try creating a temp Template (Tools - Create Metadata Template) with the description data you want to add, save this template. Open a new Bridge window select the documents and then Tools - Append Metadata - select template. With two windows open you can then swap and amend the template to change the data as required.

            • 3. Re: How append to group metadata "Description"?
              Sverk Community Member

              Philip,

              Seems like it could work -- but I can't get it to do any Append Template.

              It works only if the field is empty, if there is anything in there before, Append does nothing.

              Very strange since the very meaning of Append should be to add to whatever is there before, right?

              • 4. Re: How append to group metadata "Description"?
                Philip Cord Community Member

                Yes you are right, just tested it and it didn't work. Looks like Adobe didn't test this!

                I suppose the only other way is to use a custom Bridge script.

                • 5. Re: How append to group metadata "Description"?
                  Sverk Community Member

                  Thanks for confirming what I found,

                  Too bad though, since your suggestion would be very muck what I need -- if Append Template worked.  Adobe badly needs to fix that !

                   

                  Although I have a variety of programming experience through the years, I haven't done any Bridge or similar scripting.

                  I figure it would be very helpful for me to have an example or two of such scripting that I can take off from, if possible some scripts that do things with Bridge metadata.

                  Are there any?

                  • 6. Re: How append to group metadata "Description"?
                    Sverk Community Member

                    Continued:

                    This is how I wold want it to work, probably:

                    First I select a bunch of image files.

                    2.  I start the script which launches an input text box or similar, where I type in the text I want to Append.

                    3.  Upon OK, the script should probably go through the selected files, one by one, and

                    4.  read the content of the Description field into a string,

                    5.  add the string to append, and then write it back.

                    6.  repeat for the next selected file, until all done.

                     

                    Any script that works its way through a series of selected files would be useful to start out from and modify.

                    • 7. Re: How append to group metadata "Description"?
                      Philip Cord Community Member

                      I have been looking at a number of scripts in the Bridge scripting forum.

                      http://forums.adobe.com/community/bridge/bridge_scripting?view=discussions

                      Also at numerous scripts here.. http://www.ps-bridge-scripts.talktalk.net/

                       

                      They have helped me put this script together.

                       

                       

                      #target bridge
                         if( BridgeTalk.appName == "bridge" ) {  
                      appendDesc = MenuElement.create("command", "Append Description", "at the end of Thumbnail");
                      }
                      appendDesc.onSelect = function () { 
                      var win = new Window('dialog','Append Description');
                      win.g10 = win.add('group');
                      win.g10.st1 = win.g10.add('statictext',undefined,"Append Description");
                      win.g10.st1.alignment=["fill","fill"];
                      win.p1= win.add("panel", undefined, undefined, {borderStyle:"black"}); 
                      win.p1.alignChildren=["fill","fill"];
                      win.g20 = win.p1.add('group');
                      win.g20.spacing=10;
                      win.g20.orientation = 'row';
                      win.g20.rb1 = win.g20.add('radiobutton',undefined,'Append');
                      win.g20.rb2 = win.g20.add('radiobutton',undefined,'Replace');
                      win.g20.cb2 = win.g20.add('checkbox',undefined,'Add Carriage return');
                      win.g20.rb1.value=true;
                      win.g30 = win.p1.add('group');
                      win.g30.spacing=10;
                      win.g30.orientation = 'row';
                      win.g30.st1 = win.g30.add('statictext',undefined,'Please enter new description data...');
                      win.g40 = win.p1.add('group');
                      win.g40.spacing=10;
                      win.g40.orientation = 'row';
                      win.g40.et1 = win.g40.add('edittext');
                      win.g40.et1.preferredSize=[350,20];
                      win.g50 = win.p1.add('group');
                      win.g50.spacing=10;
                      win.g50.orientation = 'row';
                      win.g50.bu1 = win.g50.add('button',undefined,'Process Selected Files');
                      win.g50.bu1.preferredSize=[170,30];
                      win.g50.bu2 = win.g50.add('button',undefined,'Cancel');
                      win.g50.bu2.preferredSize=[170,30];
                      win.g50.bu1.onClick = function(){
                      if(win.g40.et1.text == ''){
                          alert("No text has been entered");
                          return;
                          }
                      var sels =  app.document.selections;
                      if(sels.length < 1){
                          alert("You need to select your documents before running this script");
                          win.close(1);
                          return;
                      }
                      win.close(1);
                      if ( !ExternalObject.AdobeXMPScript ) ExternalObject.AdobeXMPScript = new ExternalObject('lib:AdobeXMPScript');
                      var AppendDesc = win.g20.rb1.value;
                      if(win.g20.cb2.value){
                      var newDesc = "\n";
                      }else{
                      var newDesc ="";}
                      newDesc += win.g40.et1.text.toString();
                      app.synchronousMode = true;
                      for(var a in sels){
                      var thumb = sels[a];
                      var xmp = new XMPMeta(thumb.synchronousMetadata.serialize());
                      if(AppendDesc){
                      var dCount = xmp.countArrayItems(XMPConst.NS_DC, "description");
                      if(dCount>0){
                      var desc = xmp.getLocalizedText(XMPConst.NS_DC, "description", null, "x-default"); 
                      desc += newDesc;
                      }else{
                      desc = newDesc;
                      }
                      }else{
                      desc = newDesc;
                      }
                      xmp.setLocalizedText( XMPConst.NS_DC, "description", null, "x-default", desc );
                      var newPacket = xmp.serialize(XMPConst.SERIALIZE_USE_COMPACT_FORMAT);
                      thumb.metadata = new Metadata(newPacket);    
                          }
                      }
                      win.show();
                      };
                      
                      • 8. Re: How append to group metadata "Description"?
                        Sverk Community Member

                        Really Great Indeed !

                        From a quick glance through the script it seems you have done it all for me.

                        Unfortunately there will not be time for me to try it on today,

                        but I will sure report back soon on my progress.

                        Thanks a lot Philip !

                        Sverker

                        • 9. Re: How append to group metadata "Description"?
                          Sverk Community Member

                          I couldn't wait trying to figure out how to use the script but can't find it,

                          tried the help function but found no instructions on that.

                           

                          So I have to ask for some help on this as well.

                          Where do I install the script?

                          How do I run it after I have made my selection in Bridge?

                          Should it be integrated in Bridge somehow and run from in there?

                          Or should it run on the outside, and yet work on what is selected inside Bridge?

                           

                          Help appreciated!

                          • 10. Re: How append to group metadata "Description"?
                            Philip Cord Community Member

                            Yes there isn't too much information about scripts in Bridge, hope this helps.

                            Copy and paste the script into ExtendScript Toolkit or a plain text editor, save the file  with a .jsx extension.

                            To find the folder to where it needs to be saved, open Bridge, select Preferences - Startup Scripts

                            At the bottom click the "Reveal Button" this will open the folder where the script should be saved.

                            Re-start Bridge and accept the new script.

                            To use, select your documents, then mouse right click menu and select "Append Description"

                            Good luck.

                            • 11. Re: How append to group metadata "Description"?
                              Sverk Community Member

                              Beautiful!

                              With the instructions from you installation and running was simple.

                              And it works very well just the way it should.

                              Good idea to include a CR option also, but unfortunately that feature does not work.  Don't know why, but I could probably figure that out.

                              Thanks A Lot Philip!  Splendid help with a very useful direct solution to what has been both a tedious chore for me. And a risky chore too, risk of losing important previously entered Description metadata, a risk which occurs because all the Description field contents is selected (blue) when opening the field.  If I forgot to deselect it with the mouse and just started to type in text, it works as a Repalce.

                              But no more,

                              Thanks again,

                              Sverker

                              • 12. Re: How append to group metadata "Description"?
                                Philip Cord Community Member

                                When the checkbox is checked a carriage return is put after the original data so the new data is on it's own line.

                                Happy that it is working for you Sverker.

                                • 13. Re: How append to group metadata "Description"?
                                  Sverk Community Member

                                  Yes, that's what I thought it would do, but it didn't the first times I tried.

                                  But now it works, CR indeed gets added, all OK,

                                  Thanks!

                                  BTW:  I don't get it how the MArk as Helpful works.

                                  I certainly mean your help has been Helpful indeed!

                                  Sverker