creating a simple list of files and their resolution

General Discussion of Scripting for Adobe Bridge

Moderators: Tom, Kukurykus

John

creating a simple list of files and their resolution

Post by John »

just opened Adobe Bridge today... i'm hoping someone can help me do something which seems pretty simple ( but still beyond me )

I'm currently viewing a list of files in Adobe Bridge... and I can see the meta data for those files... but i can't seem to extract it

I just want to export a simple ( text based ) list of some files ... plus a few other meta data properties.. file size, resolution , and proportion.

Here is an example:
--------------------
Image no. 1
4.21MB
4064x2704@72dpi
--------------------
Image no. 2
6.4MB
5045x3306@72dpi
--------------------
and so on.


I tried saving the meta data as XMP... but there is too much xtra data in the file. I don't know how to extract the information i want.

I tried an application called BR's EXIF extractor ( which looks at all the images in a directory and pulls out the meta data you want ) It's simple and works great... but it does not provide dpi ( which i need )

I began looking into Adobe Bridge scripting.. but i'm no programmer.

Any help would be greatly appreciated!

-John
Patrick

creating a simple list of files and their resolution

Post by Patrick »

I will give this a try today John, I'll let you know what I find out.

Patrick
John

creating a simple list of files and their resolution

Post by John »

Thanks Patrick!

If you think this is "not" something i should be looking to Adobe Bridge to do... feel free to let me know. I just thought this might be a common use for the program, so if it's not... I don't want you to kill yourself looking for a solution.

Perhaps there is some other app. I should be using. Similar to BR's Exif Extractor http://www.br-software.com/extracter.html

This app worked very well... except for the lack of DPI info.

Best,
John
Mike Hale

creating a simple list of files and their resolution

Post by Mike Hale »

Code: Select all#target bridge

if (BridgeTalk.appName == "bridge" ) {
   var menu = MenuElement.create( "command", "Export CSV File", "at the end of Tools");
   menu.onSelect = function(m) {
   try {
      var f = File.saveDialog("Export file list to:", "Comma delimited file:*.CSV");
      if ( !f ) { return; }
      f.open("w");
      f.writeln("Name,Width,Height,Resolution");
      var items = app.document.visibleThumbnails;
      for (var i = 0; i < items.length; ++i) {
         var item = items;
         f.writeln(item.name,',',ListMetadata(item) );
      };
      f.close();
   } catch(e) {}
  };
};

function ListMetadata(tn) {
   md = tn.metadata;
   md.namespace = "http://ns.adobe.com/tiff/1.0/";
   var varXResolution = md.ImageWidth + ',' + md.ImageLength + ',' + md.XResolution;
   return varXResolution;
}
flieckster

creating a simple list of files and their resolution

Post by flieckster »

can this same script be used to pull the following data.
current date, file name, source, credit, witdh, height? also i tried to load this here. and i dont see it as an option under scripts

C:\Program Files\Common Files\Adobe\StartupScripts

am i putting this script in the wrong place?
Patrick

creating a simple list of files and their resolution

Post by Patrick »

flieckster wrote:C:\Program Files\Common Files\Adobe\StartupScripts

am i putting this script in the wrong place?

You are on the right path. That is the right place to put your scripts for Bridge, but they are only executed when Bridge is initially launched. The way scripts work in Bridge is a little different than Photoshop, main difference being you can't just do File -> Scripts and load them at will.

The way you get around this is by adding your own Bridge menus. You can fairly easily add stuff to the right click / toolbar menus and have those execute your scripts. So when you start Bridge, it will run the script at start which adds your menus, and then you just use your menus whenever you want to use the scripts.

I have some examples of this I will post later tonight, I have to dig them up - it has been awhile since I've touched Bridge scripts.

Patrick
Mike Hale

creating a simple list of files and their resolution

Post by Mike Hale »

Code: Select all#target bridge

if (BridgeTalk.appName == "bridge" ) {
   var menu = MenuElement.create( "command", "Export CSV File", "at the end of Tools");
   menu.onSelect = function(m) {
   try {
        var tDate = new Date();
        var tDay = parseInt(tDate.getMonth()+1)+'/'+tDate.getDate()+'/'+tDate.getFullYear();
      var f = File.saveDialog("Export file list to:", "Comma delimited file:*.CSV");
      if ( !f ) { return; }
      f.open("w");
      f.writeln("Date,Name,Source,Credit,Width,Height,Resolution");
      var items = app.document.visibleThumbnails;
      for (var i = 0; i < items.length; ++i) {
         var item = items;
         f.writeln(tDay,',',item.name,',',ListMetadata(item) );
      };
      f.close();
   } catch(e) {}
  };
};


function ListMetadata(tn) {
   md = tn.metadata;
   md.namespace = "http://ns.adobe.com/photoshop/1.0/";
   var res = md.Source + ',' + md.Credit; 
   md.namespace = "http://ns.adobe.com/tiff/1.0/";
   res = res + ',' + md.ImageWidth + ',' + md.ImageLength;
   return res;
}

It should appear as a menu item under tools

Mike
flieckster

creating a simple list of files and their resolution

Post by flieckster »

this seems to work. only problem is the GUI is so slow when i have to run this on hundreds if not thousands of images. is there any way to do this with out the GUI?
Mike Hale

creating a simple list of files and their resolution

Post by Mike Hale »

Bridge can be slow building thumbnails. I don't know of anyway to use Bridge without the GUI.

You could try a command line tool like Exiftool as Patrick suggested in your other post.

Mike
Patrick

creating a simple list of files and their resolution

Post by Patrick »

I think you can disable thumbnail generation in Bridge and all the images will just show up as just their filetype icon, should speed things up a little but seeing the pictures is the main point of using Bridge.