1 2 Previous Next 41 Replies Latest reply: Sep 22, 2011 1:28 PM by Paul Riggott RSS

    Script to Export and Import Keywords and Metadata

      I have a requirement to mass upload and download keywords and various metadata fields (i.e. File Name, Date Created, City, Country, Document, Title, etc.) into an external database from the Adobe Bridge. Ideally it would be compatible to .txt, .csv, etc type of database format. Currently I have to accomplish this task one at a time. I have an immediate need to upload 1000 plus pictures and various text fields into my website to share with others and be able to sell my pictures online.

      My immediate is for exporting the metadata and keywords.

      Does anyone know of a script that is aavailable?

      Arnold
        • 1. Re: Script to Export and Import Keywords and Metadata
          john beardsworth Community Member
          #target bridge

          if (BridgeTalk.appName == "bridge")
          {
          // Let's create our menu
          var menu = MenuElement.create( "command", "Export File List to Spreadsheet", "at the end of Tools");
          menu.onSelect = function(m) {
          try
          {
          // Let's ask what the name of the output file
          var f = File.saveDialog("Export file list to:", "Comma delimited file:*.CSV");

          // Write the column headings
          f.open("w");
          f.writeln("#,name,path,Author, Country, Location, CountryCode, Lens");

          // Let's get a list of all the visible thumbnails
          var items = app.document.visibleThumbnails;

          for (var i = 0; i < items.length; ++i) { var item = items[i]; f.writeln(i + 1, ",\"", item.name, "\",\"", item.path.replace(/\"/g, "\"\""), "\",\"", ListMetadata(item), "\",\"", "\"" ); } f.close(); } catch(e) { } } menu.onDisplay = function(m) { m.enabled = app.document.contentPaneMode == "filesystem" && app.document.visibleThumbnails.length > 0;
          }
          }

          function ListMetadata(tn)
          {
          md = tn.metadata;
          md.namespace = "http://ns.adobe.com/photoshop/1.0/";
          varAuthor = md.Author + "\",\"" + md.Country + "\",\"";

          md.namespace = "http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/" ;
          varLocation = md.Location + "\",\"" + md.CountryCode + "\",\"" ;

          md.namespace = "http://ns.adobe.com/exif/1.0/aux/";
          varLens = md.Lens ;

          return varAuthor + varLocation + varLens ;

          }
          • 2. Re: Script to Export and Import Keywords and Metadata
            Community Member
            John,

            Thank you for your script. I was able to figured out how to add the additionals fields to the script you provided me. It took me a while since I am not a programmer.

            Thanks again,

            Arnold
            • 3. Re: Script to Export and Import Keywords and Metadata
              john beardsworth Community Member
              Glad it helped Arnold - I hoped posting it "as is" would help you.

              John
              • 4. Re: Script to Export and Import Keywords and Metadata
                Community Member
                John,

                I have been adding to and modifying the script you supplied to me the other day and was able to add 24 fields to the Export file. Below is the updated script I have been working for over 8 hours.

                ================================================

                #target bridge

                if (BridgeTalk.appName == "bridge")
                {
                // Let's create our menu
                var menu = MenuElement.create( "command", "Export File List to Spreadsheet", "at the end of Tools");
                menu.onSelect = function(m) {
                try
                {
                // Let's ask what the name of the output file
                var f = File.saveDialog("Export file list to:", "Comma delimited file:*.CSV");

                // Write the column headings
                f.open("w");
                f.writeln("Seq Number,New File Name,New File Name Path,Original File Name,Org Dt & Tm,ISO,Exposure Time,F Stop,EV,Exposure Program,Meter Mode,Focal Length,Flash,Lens,Author, Author's Position,City,Country,Description,Title,Orientation,Width,Height,Rating,Label");

                // Let's get a list of all the visible thumbnails
                var items = app.document.visibleThumbnails;

                for (var i = 0; i < items.length; ++i) { var item = items[i]; f.writeln(i + 1, ",\"", item.name, "\",\"", item.path.replace(/\"/g, "\"\""), "\",\"", ListMetadata(item), "\",\"", "\"" ); } f.close(); } catch(e) { } } menu.onDisplay = function(m) { m.enabled = app.document.contentPaneMode == "filesystem" && app.document.visibleThumbnails.length > 0;
                }
                }

                function ListMetadata(tn)
                {
                md = tn.metadata;
                md.namespace = "http://ns.adobe.com/photoshop/1.0/";
                varAuthor = md.Author + "\",\"" + md.AuthorsPosition + "\",\"" + md.City + "\",\"" + md.Country + "\",\"";

                md.namespace = "http://ns.adobe.com/exif/1.0/aux/";
                varLens = md.Lens + "\",\"" ;

                md.namespace = "http://purl.org/dc/elements/1.1/";
                vartitle = md.title + "\",\"" + md.description + "\",\"" ;

                md.namespace = "http://ns.adobe.com/xap/1.0/mm/"
                VarPreservedFileName = md.PreservedFileName + "\",\"" ;

                md.namespace = "http://ns.adobe.com/exif/1.0/"
                VarDateTimeOriginal = md.DateTimeOriginal + "\",\"" + md.ISOSpeedRatings + "\",\"" + md.ExposureTime + "\",\"" + md.FNumber + "\",\"" + md.ExposureBiasValue + "\",\"" + md.ExposureProgram + "\",\"" + md.MeteringMode + "\",\"" + md.FocalLengthIn35mmFilm + "\",\"" + md.Flash + "\",\"" ;

                md.namespace = "http://ns.adobe.com/tiff/1.0/"
                varOrientation = md.Orientation + "\",\"" + md.ImageWidth + "\",\"" + md.ImageLength + "\",\"" ;

                md.namespace = "http://ns.adobe.com/xap/1.0/"
                varRating = md.Rating + "\",\"" + md.Label ;

                return VarPreservedFileName + VarDateTimeOriginal + varLens + varAuthor + vartitle + varOrientation + varRating;

                }

                ==========================================

                I still have 3 files I would like to add to this script but I hit a brick wall. Below are the 3 fields I would like to add this script:

                1. File size
                2. Did the flash fire?
                3. Keywords (I need to take the multiple rows that the bridge stores them in and put them in the same record the other fields are in and separate the keywords by a space or some other character.

                All help will be much appreciate. If you can't, maybe you can direct me to somebody who could help me.

                Thanks again,

                Arnold
                • 5. Re: Script to Export and Import Keywords and Metadata
                  john beardsworth Community Member
                  Thanks for posting it Arnold. The keywords will be awkward, as they're going to be a multivalue field. So you'll need to calculate their "length" (count) and use that in a for loop like in the ListMetadata function, converting it into a comma separated string. I'd probably do it as a separate function, called from a line in ListMetadata. Depending on what you ultimately want to do, it may even be easier to export the filename and keywords as a separate file so it can be imported as another table into Access.

                  Isn't Flash under the exif properties? You may be able to get at it by setting the namespace to http://ns.adobe.com/exif/1.0/Flash/ and then looking for Fired.
                  • 6. Re: Script to Export and Import Keywords and Metadata
                    john beardsworth Community Member
                    From my original ListMetadata function:
                    md.namespace = "http://ns.adobe.com/photoshop/1.0/";
                    varKeywords = ListKeywords(md) + "\",\"" ;

                    A new function:

                    function ListKeywords(md)
                    {
                    var varKeywords = "" ;
                    for (var i = 0; i < md.Keywords.length; ++i)
                    {
                    varKeywords = varKeywords + md.Keywords[i] + ", ";
                    }
                    //strip off final comma and space
                    varKeywords = varKeywords.substring( 0, varKeywords.length-2);

                    return varKeywords ;
                    }
                    • 7. Re: Script to Export and Import Keywords and Metadata
                      Community Member
                      John,

                      Thanks for your quick response. Below is the script I just modified this morning. When looking in the keyword field, it returns the word "undefined" for all records.

                      I tried that yesterday and it didn't work. When looking at the Advance file info on Adobe Bridge I see the below format which had 2 levels. All the others I used only had one. Since I am not a programmer, I need help on that part of the script.

                      ==========================

                      EXIF Properties (exif,http://ns.adobe.com/exif/1.0/)
                      - exif:Flash
                      - exif:Fired: True

                      ====================================

                      Any luck on determining how to obtain file size.

                      Again thank you so much for supporting me on my project,

                      Arnold

                      =====================
                      #target bridge

                      if (BridgeTalk.appName == "bridge")
                      {
                      // Let's create our menu
                      var menu = MenuElement.create( "command", "Export CSV File", "at the end of Tools");
                      menu.onSelect = function(m) {
                      try
                      {
                      // Let's ask what the name of the output file
                      var f = File.saveDialog("Export file list to:", "Comma delimited file:*.CSV");

                      // Write the column headings
                      f.open("w");
                      f.writeln("Seq Number,New File Name,New File Name Path,Original File Name,Org Dt & Tm,ISO,Exposure Time,F Stop,EV,Exposure Program,Meter Mode,Focal Length,Flash,Lens,Author, Author's Position,City,Country,Description,Title,Orientation,Width,Height,Rating,Label");

                      // Let's get a list of all the visible thumbnails
                      var items = app.document.visibleThumbnails;

                      for (var i = 0; i < items.length; ++i) { var item = items[i]; f.writeln(i + 1, ",\"", item.name, "\",\"", item.path.replace(/\"/g, "\"\""), "\",\"", ListMetadata(item), "\",\"", "\"" ); } f.close(); } catch(e) { } } menu.onDisplay = function(m) { m.enabled = app.document.contentPaneMode == "filesystem" && app.document.visibleThumbnails.length > 0;
                      }
                      }

                      function ListMetadata(tn)
                      {
                      md = tn.metadata;
                      md.namespace = "http://ns.adobe.com/photoshop/1.0/";
                      varAuthor = md.Author + "\",\"" + md.AuthorsPosition + "\",\"" + md.City + "\",\"" + md.Country + "\",\"";

                      md.namespace = "http://ns.adobe.com/exif/1.0/aux/";
                      varLens = md.Lens + "\",\"" ;

                      md.namespace = "http://purl.org/dc/elements/1.1/";
                      vartitle = md.title + "\",\"" + md.description + "\",\"" ;

                      md.namespace = "http://ns.adobe.com/xap/1.0/mm/"
                      VarPreservedFileName = md.PreservedFileName + "\",\"" ;

                      md.namespace = "http://ns.adobe.com/exif/1.0/"
                      VarDateTimeOriginal = md.DateTimeOriginal + "\",\"" + md.ISOSpeedRatings + "\",\"" + md.ExposureTime + "\",\"" + md.FNumber + "\",\"" + md.ExposureBiasValue + "\",\"" + md.ExposureProgram + "\",\"" + md.MeteringMode + "\",\"" + md.FocalLengthIn35mmFilm + "\",\"" + md.Flash + "\",\"" ;

                      md.namespace = "http://ns.adobe.com/tiff/1.0/"
                      varOrientation = md.Orientation + "\",\"" + md.ImageWidth + "\",\"" + md.ImageLength + "\",\"" ;

                      md.namespace = "http://ns.adobe.com/xap/1.0/"
                      varRating = md.Rating + "\",\"" + md.Label ;

                      md.namespace = "http://ns.adobe.com/photoshop/1.0/";
                      varKeywords = ListKeywords(md) + "\",\"" ;

                      function ListKeywords(md)
                      {
                      var varKeywords = "" ;
                      for (var i = 0; i < md.Keywords.length; ++i) { varKeywords = varKeywords + md.Keywords[i] + ", "; } //strip off final comma and space varKeywords = varKeywords.substring( 0, varKeywords.length-2);
                      }

                      return VarPreservedFileName + VarDateTimeOriginal + varLens + varAuthor + vartitle + varOrientation + varRating + varKeywords;

                      }

                      ==============================
                      • 8. Re: Script to Export and Import Keywords and Metadata
                        john beardsworth Community Member
                        You see to have placed the keywords function inside the existing function. Not sure if this is right - I put it outside.
                        • 9. Re: Script to Export and Import Keywords and Metadata
                          Community Member
                          John,

                          I try to put it outside and it still didn't work. See below for my new script. I would reeally, really .... really appreciate if you could place the Keyword script in the correct location.

                          Thanks,

                          Arnold

                          =======================

                          #target bridge

                          if (BridgeTalk.appName == "bridge")
                          {
                          // Let's create our menu
                          var menu = MenuElement.create( "command", "Export CSV File", "at the end of Tools");
                          menu.onSelect = function(m) {
                          try
                          {
                          // Let's ask what the name of the output file
                          var f = File.saveDialog("Export file list to:", "Comma delimited file:*.CSV");

                          // Write the column headings
                          f.open("w");
                          f.writeln("Seq Number,New File Name,New File Name Path,Original File Name,Org Dt & Tm,ISO,Exposure Time,F Stop,EV,Exposure Program,Meter Mode,Focal Length,Flash,Lens,Author, Author's Position,City,Country,Description,Title,Orientation,Width,Height,Rating,Label,KeyWords");

                          // Let's get a list of all the visible thumbnails
                          var items = app.document.visibleThumbnails;

                          for (var i = 0; i < items.length; ++i) { var item = items[i]; f.writeln(i + 1, ",\"", item.name, "\",\"", item.path.replace(/\"/g, "\"\""), "\",\"", ListMetadata(item), "\",\"", "\"" ); } f.close(); } catch(e) { } } menu.onDisplay = function(m) { m.enabled = app.document.contentPaneMode == "filesystem" && app.document.visibleThumbnails.length > 0;
                          }
                          }

                          function ListMetadata(tn)
                          {
                          md = tn.metadata;
                          md.namespace = "http://ns.adobe.com/photoshop/1.0/";
                          varAuthor = md.Author + "\",\"" + md.AuthorsPosition + "\",\"" + md.City + "\",\"" + md.Country + "\",\"";

                          md.namespace = "http://ns.adobe.com/exif/1.0/aux/";
                          varLens = md.Lens + "\",\"" ;

                          md.namespace = "http://purl.org/dc/elements/1.1/";
                          vartitle = md.title + "\",\"" + md.description + "\",\"" ;

                          md.namespace = "http://ns.adobe.com/xap/1.0/mm/"
                          VarPreservedFileName = md.PreservedFileName + "\",\"" ;

                          md.namespace = "http://ns.adobe.com/exif/1.0/"
                          VarDateTimeOriginal = md.DateTimeOriginal + "\",\"" + md.ISOSpeedRatings + "\",\"" + md.ExposureTime + "\",\"" + md.FNumber + "\",\"" + md.ExposureBiasValue + "\",\"" + md.ExposureProgram + "\",\"" + md.MeteringMode + "\",\"" + md.FocalLengthIn35mmFilm + "\",\"" + md.Flash + "\",\"" ;

                          md.namespace = "http://ns.adobe.com/tiff/1.0/"
                          varOrientation = md.Orientation + "\",\"" + md.ImageWidth + "\",\"" + md.ImageLength + "\",\"" ;

                          md.namespace = "http://ns.adobe.com/xap/1.0/"
                          varRating = md.Rating + "\",\"" + md.Label ;

                          return VarPreservedFileName + VarDateTimeOriginal + varLens + varAuthor + vartitle + varOrientation + varRating;

                          }

                          function ListKeywords(md)
                          {

                          var varKeywords = "" ;
                          for (var i = 0; i < md.Keywords.length; ++i) { varKeywords = varKeywords + md.Keywords[i] + ", "; } //strip off final comma and space varKeywords = varKeywords.substring( 0, varKeywords.length-2);

                          md.namespace = "http://ns.adobe.com/photoshop/1.0/";
                          varKeywords = ListKeywords(md) + "\",\"" ;

                          return varKeywords ;
                          }
                          • 10. Re: Script to Export and Import Keywords and Metadata
                            john beardsworth Community Member
                            In ListMetadata, you dropped out the reference to ListKeywords. I just ran this and exported keywords as expected.

                            #target bridge

                            if (BridgeTalk.appName == "bridge")
                            {
                            // Let's create our menu
                            var menu = MenuElement.create( "command", "Export CSV File", "at the end of Tools");
                            menu.onSelect = function(m) {
                            try
                            {
                            // Let's ask what the name of the output file
                            var f = File.saveDialog("Export file list to:", "Comma delimited file:*.CSV");

                            // Write the column headings
                            f.open("w");
                            f.writeln("Seq Number,New File Name,New File Name Path,Original File Name,Org Dt & Tm,ISO,Exposure Time,F Stop,EV,Exposure Program,Meter Mode,Focal Length,Flash,Lens,Author, Author's Position,City,Country,Description,Title,Orientation,Width,Height,Rating,Label,KeyWords");

                            // Let's get a list of all the visible thumbnails
                            var items = app.document.visibleThumbnails;

                            for (var i = 0; i < items.length; ++i) { var item = items[i]; f.writeln(i + 1, ",\"", item.name, "\",\"", item.path.replace(/\"/g, "\"\""), "\",\"", ListMetadata(item), "\",\"", "\"" ); } f.close(); } catch(e) { } } menu.onDisplay = function(m) { m.enabled = app.document.contentPaneMode == "filesystem" && app.document.visibleThumbnails.length > 0;
                            }
                            }

                            function ListMetadata(tn)
                            {
                            md = tn.metadata;
                            md.namespace = "http://ns.adobe.com/photoshop/1.0/";
                            varAuthor = md.Author + "\",\"" + md.AuthorsPosition + "\",\"" + md.City + "\",\"" + md.Country + "\",\"";
                            varKeywords = ListKeywords(md);

                            md.namespace = "http://ns.adobe.com/exif/1.0/aux/";
                            varLens = md.Lens + "\",\"" ;

                            md.namespace = "http://purl.org/dc/elements/1.1/";
                            vartitle = md.title + "\",\"" + md.description + "\",\"" ;

                            md.namespace = "http://ns.adobe.com/xap/1.0/mm/"
                            VarPreservedFileName = md.PreservedFileName + "\",\"" ;

                            md.namespace = "http://ns.adobe.com/exif/1.0/"
                            VarDateTimeOriginal = md.DateTimeOriginal + "\",\"" + md.ISOSpeedRatings + "\",\"" + md.ExposureTime + "\",\"" + md.FNumber + "\",\"" + md.ExposureBiasValue + "\",\"" + md.ExposureProgram + "\",\"" + md.MeteringMode + "\",\"" + md.FocalLengthIn35mmFilm + "\",\"" + md.Flash + "\",\"" ;

                            md.namespace = "http://ns.adobe.com/tiff/1.0/"
                            varOrientation = md.Orientation + "\",\"" + md.ImageWidth + "\",\"" + md.ImageLength + "\",\"" ;

                            md.namespace = "http://ns.adobe.com/xap/1.0/"
                            varRating = md.Rating + "\",\"" + md.Label ;

                            return VarPreservedFileName + VarDateTimeOriginal + varLens + varAuthor + vartitle + varOrientation + varRating + varKeywords;

                            }

                            function ListKeywords(md)
                            {

                            var varKeywords = "" ;
                            for (var i = 0; i < md.Keywords.length; ++i) { varKeywords = varKeywords + md.Keywords[i] + ", "; } //strip off final comma and space varKeywords = varKeywords.substring( 0, varKeywords.length-2);

                            md.namespace = "http://ns.adobe.com/photoshop/1.0/";
                            varKeywords = ListKeywords(md) + "\",\"" ;

                            return varKeywords ;
                            }
                            • 11. Re: Script to Export and Import Keywords and Metadata
                              Community Member
                              John,

                              I install the script you just provided me in the Adobe StartupScripts folder where I have been testing all my other updates. This recent script only gives me one record and stops on KeyWords field and has the word "undefined" in it. What am I doing wrong??

                              Arnold
                              • 12. Re: Script to Export and Import Keywords and Metadata
                                There were a couple of errors in the script.

                                Bob
                                Adobe WAS Scripting

                                Try this, save it to your startup scripts folder:

                                #target bridge

                                if (BridgeTalk.appName == "bridge" ) {

                                // Let's create our menu
                                var menu = MenuElement.create( "command", "Export CSV File", "at the end of Tools");
                                menu.onSelect = function(m) {
                                try {
                                // Let's ask what the name of the output file
                                var f = File.saveDialog("Export file list to:", "Comma delimited file:*.CSV");

                                if ( !f ) { return; }

                                // Write the column headings
                                f.open("w");
                                f.writeln("Seq Number,New File Name,New File Name Path,Original File Name,Org Dt & Tm,ISO,Exposure Time,F Stop,EV,Exposure Program,Meter Mode,Focal Length,Flash,Lens,Author, Author's Position,City,Country,Description,Title,Orientation,Width,Height,Rating,Label,KeyWords");


                                // Let's get a list of all the visible thumbnails
                                var items = app.document.visibleThumbnails;

                                for (var i = 0; i < items.length; ++i) {
                                var item = items[i];
                                f.writeln(i + 1, ",\"", item.name, "\",\"", item.path.replace(/\"/g, "\"\""), "\",\"", ListMetadata(item), "\",\"", "\"" );
                                }

                                f.close();
                                } catch(e) {
                                }
                                }
                                }

                                function ListMetadata(tn) {

                                md = tn.metadata;
                                md.namespace = "http://ns.adobe.com/photoshop/1.0/";
                                var varAuthor = md.Author + "\",\"" + md.AuthorsPosition + "\",\"" + md.City + "\",\"" + md.Country + "\",\"";

                                var varKeywords = ListKeywords(md);

                                md.namespace = "http://ns.adobe.com/exif/1.0/aux/";
                                var varLens = md.Lens + "\",\"" ;

                                md.namespace = "http://purl.org/dc/elements/1.1/";
                                var vartitle = md.title + "\",\"" + md.description + "\",\"" ;

                                md.namespace = "http://ns.adobe.com/xap/1.0/mm/"
                                var VarPreservedFileName = md.PreservedFileName + "\",\"" ;

                                md.namespace = "http://ns.adobe.com/exif/1.0/"
                                var VarDateTimeOriginal = md.DateTimeOriginal + "\",\"" + md.ISOSpeedRatings + "\",\"" + md.ExposureTime + "\",\"" + md.FNumber + "\",\"" +
                                md.ExposureBiasValue + "\",\"" + md.ExposureProgram + "\",\"" + md.MeteringMode
                                + "\",\"" + md.FocalLengthIn35mmFilm + "\",\"" + md.Flash + "\",\"" ;

                                md.namespace = "http://ns.adobe.com/tiff/1.0/"
                                var varOrientation = md.Orientation + "\",\"" + md.ImageWidth + "\",\"" +
                                md.ImageLength + "\",\"" ;

                                md.namespace = "http://ns.adobe.com/xap/1.0/"
                                var varRating = md.Rating + "\",\"" + md.Label + "\",\"";

                                return VarPreservedFileName + VarDateTimeOriginal + varLens + varAuthor + vartitle + varOrientation + varRating + varKeywords;

                                }

                                function ListKeywords(md) {
                                md.namespace = "http://ns.adobe.com/photoshop/1.0/";
                                var Keywords = md.Keywords;

                                var varKeywords = "" ;
                                for ( var i = 0; i < Keywords.length; ++i ) {
                                varKeywords = varKeywords + Keywords[i] + ", ";
                                }
                                //strip off final comma and space varKeywords =
                                varKeywords.substring( 0, varKeywords.length-2);

                                return varKeywords ;
                                }
                                • 13. Re: Script to Export and Import Keywords and Metadata
                                  Community Member
                                  Robert,

                                  Thanks for your quick response. The script you modified works fine.

                                  Can I impose on you to add to this script for the picture file size and flash elements (i.e. did strobe light fire, mode - auto, etc.)?

                                  Thanks again,

                                  Arnold
                                  • 14. Re: Script to Export and Import Keywords and Metadata
                                    heathrowe CommunityMVP
                                    Super stuff Bob :)
                                    heathrowe
                                    • 15. Re: Script to Export and Import Keywords and Metadata
                                      If I may kindly piggyback on all the work Bob & Arnold have done: I too have been looking for a way to be able to provide clients with the medadata for images from their shoot, and the script that you have just made looks like IT. I have never worked with scripts, and it would help me if you could post three things for me (or is there an easier way to get it to me?)
                                      1: the final, corrected script you have worked out, and
                                      2: where to go for an informative guide about scripts that will tell me, from the begining, how to make one, install this one, and troubleshoot them.
                                      3. How I can download all 14 of your postings in one file, so I can try to trace your prosess? (Seems like this is a good tool for the next Bridge revision.)
                                      • 16. Re: Script to Export and Import Keywords and Metadata
                                        Community Member
                                        Chris,

                                        Barredrock software (www.barredrocksoftware.com) has a script for sale that is a generalized metadata exporter. It will do what you need in a more general case.

                                        I don't know what they charge for it, but I don't think anything on their site is more that $15.

                                        The only definitive guide is the bridge scripting guide that is on your CD, and download-able from Adobe Exchange. You can also purchase a hardcopy from Adobe Press.

                                        At the bottom of the forum message display you'll see "Show All Messages" on the right side of the same bar that contains the "First, Previous, Next, Last" options.

                                        Bob
                                        Adobe Workflow Scripting
                                        • 17. Re: Script to Export and Import Keywords and Metadata
                                          Community Member
                                          Thanks Bob. Barredrock seems like just the ticket for my needs. That Scripting Guide is a little intimitating. ( I avoided having to learn dos by going Mac; avoided having to learn html with Dreamweaver; now will I have to confront scripting...?)
                                          • 18. Re: Script to Export and Import Keywords and Metadata
                                            Community Member
                                            Chris,

                                            Should you learn scripting? Well, it kinda depends on what you do and what you need. There are folks out there who will write scripts for you, some for free, some for money, but if you really need something now and it doesn't exist, knowing how to script could be invaluable to you. If the script wasn't available from Barred Rock, you'd be looking at having weeks of monkey-level work. (weeks because you'd drive yourself crazy if you tried to do it one sitting). To you, Barredrock's script is worth a lot.

                                            To me (and I am very biased here), the most important features of CS2 and the CS2 products are Bridge and the new scripting feature set. Here's why...

                                            Bridge is virtually completely scriptable. While there are a couple of exceptions, just about anything you might want to do is possible via the scripting interface. The more I get to know the folks who implemented these features, the more impressed I am with the depth of their original vision.

                                            One of the features, BridgeTalk, allows scripts of arbitrary complexity to be executed on other Adobe products. Stated another way, you can write a script that will be executed from Bridge that will be sent from bridge to Photoshop (or InDesign, GoLive, Illustrator). That script will be executed in the target environment, and any results returned back to Bridge. You can also go from the point products to each other.

                                            If you combine the two concepts, you have an environment that allows you to do almost anything. You can add features to Bridge via scripting, and anything you might need from any of the Adobe products is available to you. That is a fantastic concept. From a product line capability standpoint, Bridge is nothing less than sheer brilliance because it provides the hub necessary to do almost anything.

                                            Think of anything you might have to do repetetively on a set of files. Go to photoshop to standardize image, size, resolution, color mode, etc. Take the new images and put them in a contact sheet in ID, or generate some HTML for a web gallery, or...

                                            Adobe Stock Photos is a script. You're working in InDesign, and need a stock photo - you flip to Bridge, search, purchase, and place. It can't get much easier than that.

                                            Since Bridge is in it's first incarnation, and it's early in the 1.0 product cycle, we're only now starting to see scripts for Bridge come available. As time progresses, the number of scripts available will only grow. I see the day coming when folks will be selecting from a mountain of scripts to make Bridge do exactly what they need in their daily work. Each user's Bridge installation will be uniquely tailored to their needs. This capability is only possible by scripting.

                                            The example scripts we wrote (Contact Sheet for ID, Export to Flash, Import from Camera) were really just example scripts to show how automation features could be added to Bridge. Eventually (and experience tells us it will happen), people will take these examples and build some wonderful new widgets. It just takes time to get the ball rolling.

                                            Should you take the time and effort to learn it? It depends on you and your needs. I can guarantee you that it will be time well-spent and you will not regret it. I would suggest purchasing a JavaScript book first. Once you understand the language, the scripting guide won't seem so formidable.

                                            Bob
                                            Adobe Workflow Scripting
                                            • 19. Re: Script to Export and Import Keywords and Metadata
                                              Community Member
                                              John, Bob,

                                              wow, I just got hot all over reading this thread. Arnold, thank you for starting it! I can't believe it, it is exactly the type of thing that I was looking for. It worked perfectly and sucked right up into my mySQL DB where I can also output it as XML. LOVELY!

                                              I look forward to breaking the code apart a bit to see what you did and how you did it. I will look through the bridge scripting reference guide to figure out how to get it to work ONLY on images that are selected. I get really nervous looking at lines like: md.namespace = "http://ns.adobe.com/xap/1.0/mm/" which make me feel like we're somehow/for some reason pointing to a URL that may be broken in the future, but what do I know?

                                              Thanks guys for such great work! Shoot, now another thing to learn!

                                              -Alastair
                                              • 20. Re: Script to Export and Import Keywords and Metadata
                                                Community Member
                                                Alastair_Halliday@adobeforums.com wrote:
                                                >
                                                > I get really nervous looking at lines like: md.namespace = "http://ns.adobe.com/xap/1.0/mm/" which make me feel like we're somehow/for some reason pointing to a URL that may be broken in the future, but what do I know?
                                                >
                                                Don't worry. It's the URL that's important, not the content that may or may not
                                                be at that URL.

                                                -X
                                                • 21. Re: Script to Export and Import Keywords and Metadata
                                                  Community Member
                                                  thanks X. Hey, so where can I find a list of the variables that I can get access to? I know that The guys above have listed them in the code, but I want some documentation. Any idea?

                                                  -a
                                                  • 22. Re: Script to Export and Import Keywords and Metadata
                                                    I am having trouble locating the extension on the site you had mentioned, about exporting metadata from Adobe Bridge to another application. If you have any further more discript detail to pick up the code, it would be extremely helpful!!
                                                    • 23. Re: Script to Export and Import Keywords and Metadata
                                                      Community Member
                                                      I have a script to export metadata from Bridge to CSV.

                                                      email me off-line

                                                      rstucky@starband.net

                                                      Regards

                                                      Bob
                                                      • 24. Re: Script to Export and Import Keywords and Metadata
                                                        Hi,
                                                        I was looking for some sort of metadata export thing and just read through this thread and tried out the script and it works great. I was just wondering though, is there anyway to make this work kinda like the InDesign Contactsheet script (IE, write to an indesign file) and maybe a pop up box to select which metatdata information to write? ?

                                                        what I was really looking for is a contact sheet with the meetadata , so i get a little thumbnail too. but i really can't find anything out there that does this.
                                                        • 25. Re: Script to Export and Import Keywords and Metadata
                                                          Community Member
                                                          yes.. me to???

                                                          Is there a way of creating contact sheets that show the keywords etc???

                                                          I am in the process of designing an image library & I need to show certain clients their images with keywords so that they can approve them??? help!!

                                                          amy..
                                                          • 26. Re: Script to Export and Import Keywords and Metadata
                                                            Community Member
                                                            Amy_Kane@adobeforums.com wrote:
                                                            >
                                                            > Is there a way of creating contact sheets that show the keywords etc???
                                                            >
                                                            > I am in the process of designing an image library & I need to show certain clients their images with keywords so that they can approve them??? help!!

                                                            I can get you a tweaked version of CSX if that would help.
                                                            http://ps-scripts.sourceforge.net/ContactSheetX/csx.html

                                                            I'm not planning on offering full metadata caption support for a couple of
                                                            months but I can handle just keywords fairly easily.

                                                            -X

                                                            --
                                                            for photoshop scripting solutions of all sorts
                                                            contact: xbytor@gmail.com
                                                            • 27. Re: Script to Export and Import Keywords and Metadata
                                                              Hi,

                                                              I installed the script to Bridge and it even lists it under the "manage scripts" dialogue box... unfortunately, when I export the contact sheet by going to tools>indesign>contact sheet, all it exports is the same information it exported before - not the metadata.

                                                              Can anyone walk me through this?

                                                              Thanks!
                                                              • 28. Re: Script to Export and Import Keywords and Metadata
                                                                Community Member
                                                                I dont think that I ever got this to work either???

                                                                sorry!

                                                                but if anyone helps you... id like to know also!
                                                                • 29. Re: Script to Export and Import Keywords and Metadata
                                                                  Read through this thread and found lots of helpful info. I'm having a problem with script that reads metadata correctly in Bridge CS2 but fails to retrieve the variables under:

                                                                  ps1.namespace = "http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/"

                                                                  when trying to run it under Bridge CS3. I found the same issues trying the iterations in this thread. What am I doing wrong?

                                                                  Here's my script:

                                                                  //------------------------------------------------------------------
                                                                  RunScript4.run = function( )
                                                                  {
                                                                  var thumbs = getBridgeThumbnails ( TYPES.PHOTOSHOP_OPENABLE, false, true);
                                                                  try
                                                                  {
                                                                  var f = File.saveDialog("Enter Filename for Export:", "Double delimited file:*.txt");
                                                                  if(!f)
                                                                  {
                                                                  Window.alert ("Export Metadata:" + "\n" + "No filename entered.");
                                                                  }
                                                                  else
                                                                  {
                                                                  f.open("w");
                                                                  // Create header line
                                                                  var headerLine = f.write ( "~Filename~,~Title~,~Author~,~Copyright~,~Address~,~City~,~State~,~Zip~,~Phone~,~Email~,~ Website~" + "\n") ;
                                                                  // Loop through selected thumbnails
                                                                  for ( var i = 0; i < thumbs.length; i++)
                                                                  {
                                                                  thumb = thumbs[i];
                                                                  ps1 = thumb.metadata;
                                                                  // write metadata to file
                                                                  var imageData = f.write ("~" +thumb.name + "~,", metaData(thumb),"\n");
                                                                  }
                                                                  f.close();
                                                                  //
                                                                  if (i == 1)
                                                                  Window.alert ("There was " + i + " record exported to " + f + ". ");
                                                                  else
                                                                  Window.alert ("There were " + i + " records exported to " + f + ". ");
                                                                  }// end filename else
                                                                  }// end try
                                                                  catch(e)
                                                                  {
                                                                  // Errors handled here
                                                                  }
                                                                  }// end function

                                                                  function metaData()
                                                                  {
                                                                  ps1.namespace = "http://ns.adobe.com/photoshop/1.0/";
                                                                  fileInfo = "~" + ps1.AuthorsPosition + "~,~" + ps1.Author + "~,~" + ps1.Copyright + "~,~";

                                                                  ps1.namespace = "http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/";
                                                                  fileInfo = fileInfo + ps1.CiAdrExtadr + "~,~" + ps1.CiAdrCity + "~,~" + ps1.CiAdrRegion + "~,~" + ps1.CiAdrPcode + "~,~" + ps1.CiTelWork + "~,~" + ps1.CiEmailWork + "~,~" + ps1.CiUrlWork + "~";

                                                                  return fileInfo;
                                                                  }
                                                                  //-------------------------------------------------------------------
                                                                  • 30. Re: Script to Export and Import Keywords and Metadata
                                                                    Community Member
                                                                    There is a pretty good export metadata script up on my website.

                                                                    www.creativescripting.net

                                                                    Look for the barred rock scripts. It's in that set.

                                                                    Regards

                                                                    Bob
                                                                    www.creativescripting.net
                                                                    for all your Bridge and InDesign scripting needs
                                                                    • 31. Re: Script to Export and Import Keywords and Metadata
                                                                      Community Member
                                                                      Bob,

                                                                      Thanks for the response these seem to be a great utilities. However, the script that you directed me to does not allow me to retrieve data from the specific entries I need as listed above. i.e. "http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/" - address, city, state, zip, phone, email and website.

                                                                      The script I have works fine in CS2. I would like to migrate completely to CS3, but I can't get this script to work. Hopefully someone knows a solution.

                                                                      Paul
                                                                      • 32. Re: Script to Export and Import Keywords and Metadata
                                                                        Community Member
                                                                        i have been over seas for a while... I have come back & installed the script and its working!!!

                                                                        just wanted to say Thanks!!!

                                                                        I am in the middle of creating a Image Library for our company and we are developing it with Index Server and I need to supply lists of the keywords used & this script is great as it gives me a file with all the keywords in one document...

                                                                        thanks again!
                                                                        • 33. Re: Script to Export and Import Keywords and Metadata
                                                                          Community Member
                                                                          I will have a look at it; however, at this time I am horribly buried in work. I'll get to it as quickly as I can.

                                                                          Bob
                                                                          • 34. Re: Script to Export and Import Keywords and Metadata
                                                                            Community Member
                                                                            Not sure how active this forum is, but will try anyway. I am looking for a script to insert in an action to add Filename in Metadata through Bridge. I am a Photographer and work w/ LR V1.3.1.
                                                                            The LR works fine, but when exporting images, the app will not tick the Copyright Status Switch or the Copyright information.

                                                                            I have written actions to overcome this, but still have to add Document Name to each file.

                                                                            Is there a better way?

                                                                            Thanks,
                                                                            Alex@bachnickphoto.com
                                                                            • 35. Re: Script to Export and Import Keywords and Metadata
                                                                              Hi folks,

                                                                              This is really Great work!!! Thanks so much.

                                                                              2 questions:
                                                                              1.Is is possible to export directly to an access database table?
                                                                              2.I am using CS3 but can only get the info for 3 images to show up any idea why.

                                                                              By the way for any newbies like me you have to copy the code you see in the posting into notepad or Adobe ExtenScript Toolkit2 and save the file as a .jsx file.

                                                                              Then in Bridge select edit/preferences/startup scripts and click the button "Reveal" to see where you scripts folder is on your system. Then you just save your file to that folder. Shut down Bridge reopen it and you will be asked if you would like to install the script. Once it's installed you will see it listed at the bottom of the tools drop down.

                                                                              Here is my code:

                                                                              #target bridge

                                                                              if (BridgeTalk.appName == "bridge")
                                                                              {
                                                                              // Let's create our menu
                                                                              var menu = MenuElement.create( "command", "Export File List to Excel", "at the end of Tools");
                                                                              menu.onSelect = function(m) {
                                                                              try
                                                                              {
                                                                              // Let's ask what the name of the output file
                                                                              var f = File.saveDialog("Export file list to:", "Microsoft Office Excel Workbook:*.XLS");

                                                                              // Write the column headings
                                                                              f.open("w");
                                                                              f.writeln("#,Image_Name,Copyright,");

                                                                              // Let's get a list of all the visible thumbnails
                                                                              var items = app.document.visibleThumbnails;

                                                                              for (var i = 0; i < items.length; ++i) { var item = items[i]; f.writeln(i + 1, ",\"", item.name, "\",\"", ListMetadata(item), "\",\"", "\"" ); } f.close(); } catch(e) { } } menu.onDisplay = function(m) { m.enabled = app.document.contentPaneMode == "filesystem" && app.document.visibleThumbnails.length > 0;
                                                                              }
                                                                              }

                                                                              function ListMetadata(tn)
                                                                              {
                                                                              md = tn.metadata;
                                                                              md.namespace = "http://ns.adobe.com/photoshop/1.0/";
                                                                              varCopyright = md.Copyright + "\",\"" ;

                                                                              return varCopyright;

                                                                              }

                                                                              Many Thanks
                                                                              Sylvia
                                                                              • 36. Re: Script to Export and Import Keywords and Metadata
                                                                                Paul Riggott Community Member
                                                                                Paul, is this something like?

                                                                                #target bridge
                                                                                if (BridgeTalk.appName == "bridge" ) {
                                                                                var menu = MenuElement.create( "command", "Export Info to Text File", "at the end of Tools");
                                                                                menu.onSelect = function(m) {
                                                                                try {
                                                                                var f = File.saveDialog("Export file list to:", "Text file:*.TXT");
                                                                                if ( !f ) { return; }
                                                                                f.open("w");
                                                                                f.writeln( "~Filename~,~Title~,~Author~,~Copyright~,~Address~,~City~,~State~,~Zip~,~Phone~,~Email~,~ Website~" + "\n");
                                                                                var items = app.document.selections;
                                                                                for (var i = 0; i < items.length; ++i) {
                                                                                var item = items[i];
                                                                                f.writeln(item.name,',',ListMetadata(item) );
                                                                                };
                                                                                f.close();
                                                                                } catch(e) {}
                                                                                };
                                                                                };

                                                                                function ListMetadata(tn) {
                                                                                md = tn.metadata;
                                                                                md.namespace = "http://ns.adobe.com/photoshop/1.0/";
                                                                                var fileInfo = "~" + md.AuthorsPosition + "~,~" + md.Author + "~,~" + md.Copyright + "~,~";
                                                                                md.namespace = "http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/";
                                                                                var myCity = md.read("http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/", "Iptc4xmpCore:CreatorContactInfo/Iptc4xmpCore:CiAdrCity");
                                                                                var myRegion = md.read("http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/", "Iptc4xmpCore:CreatorContactInfo/Iptc4xmpCore:CiAdrRegion");
                                                                                var myPostCode = md.read("http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/", "Iptc4xmpCore:CreatorContactInfo/Iptc4xmpCore:CiAdrPcode");
                                                                                var myCountry = md.read("http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/", "Iptc4xmpCore:CreatorContactInfo/Iptc4xmpCore:CiAdrCtry");
                                                                                var myTel = md.read("http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/", "Iptc4xmpCore:CreatorContactInfo/Iptc4xmpCore:CiTelWork");
                                                                                myTel = myTel.replace(/\n/g, ' ');
                                                                                var myEmail = md.read("http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/", "Iptc4xmpCore:CreatorContactInfo/Iptc4xmpCore:CiEmailWork");
                                                                                var myURL = md.read("http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/", "Iptc4xmpCore:CreatorContactInfo/Iptc4xmpCore:CiUrlWork");
                                                                                var myAddress = md.read("http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/", "Iptc4xmpCore:CreatorContactInfo/Iptc4xmpCore:CiAdrExtadr");
                                                                                myAddress = myAddress.replace(/\n/g, ' ');
                                                                                fileInfo += myAddress + "~,~" + myCountry + "~,~" + myRegion + "~,~" + myPostCode + "~,~" + myTel + "~,~" + myEmail + "~,~" + myURL + "~";
                                                                                return fileInfo;
                                                                                };
                                                                                • 37. Re: Script to Export and Import Keywords and Metadata
                                                                                  Paul Riggott Community Member
                                                                                  Sylvia:-
                                                                                  It may be possible to export to workbook, but it would have to be done with VB.
                                                                                  Your second question, it might be that the fourth file is NOT a valid photoshop file. It might be better to change the code to selections and see if that works.

                                                                                  Paul.
                                                                                  • 38. Re: Script to Export and Import Keywords and Metadata
                                                                                    Community Member
                                                                                    Paul R.,

                                                                                    Sorry I haven't been back to look at your response and help before today. This appears to be "right on" getting the information I need. I'm relatively new to scripting Bridge so I'll see if I can learn from your example and apply it to the script I have been using in CS2. Hopefully there won't be any script surprises in CS4.

                                                                                    Thanks again...
                                                                                    paulshoe
                                                                                    • 39. Re: Script to Export and Import Keywords and Metadata
                                                                                      Community Member
                                                                                      Thanks for answer

                                                                                      Good Luck.
                                                                                      ______
                                                                                      My Si tes
                                                                                      1 2 Previous Next