creating a simple list of files and their resolution

General Discussion of Scripting for Adobe Bridge

Moderator: PS-Moderators

creating a simple list of files and their resolution

Postby John » Fri Sep 01, 2006 9:39 pm

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
John
 
Posts: 2
Joined: Fri Sep 01, 2006 9:19 pm

Postby Patrick » Sun Sep 03, 2006 2:49 pm

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

Patrick
Patrick
 
Posts: 780
Joined: Thu May 11, 2006 3:36 am
Location: Missouri, USA

Postby John » Tue Sep 05, 2006 2:38 pm

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
John
 
Posts: 2
Joined: Fri Sep 01, 2006 9:19 pm

Postby Mike Hale » Mon Nov 06, 2006 2:35 am

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[i];
         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;
}
Mike Hale
Site Admin
 
Posts: 4332
Joined: Fri Sep 30, 2005 10:52 pm
Location: USA

Postby flieckster » Wed Mar 12, 2008 6:16 pm

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?
Brian Flieck
flieckster
 
Posts: 38
Joined: Tue Dec 25, 2007 3:51 am
Location: King of prussia PA

Postby Patrick » Wed Mar 12, 2008 11:18 pm

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
Photoshop CS4 / JavaScript / Windows XP
Patrick
 
Posts: 780
Joined: Thu May 11, 2006 3:36 am
Location: Missouri, USA

Postby Mike Hale » Thu Mar 13, 2008 12:50 am

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[i];
         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
Mike Hale
Site Admin
 
Posts: 4332
Joined: Fri Sep 30, 2005 10:52 pm
Location: USA

Postby flieckster » Thu Mar 13, 2008 11:39 am

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?
Brian Flieck
flieckster
 
Posts: 38
Joined: Tue Dec 25, 2007 3:51 am
Location: King of prussia PA

Postby Mike Hale » Thu Mar 13, 2008 2:14 pm

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
Mike Hale
Site Admin
 
Posts: 4332
Joined: Fri Sep 30, 2005 10:52 pm
Location: USA

Postby Patrick » Thu Mar 13, 2008 2:22 pm

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.
Photoshop CS4 / JavaScript / Windows XP
Patrick
 
Posts: 780
Joined: Thu May 11, 2006 3:36 am
Location: Missouri, USA

Postby flieckster » Fri Mar 14, 2008 3:54 am

patrick do you know the VBS script to use exiftool to genarate csv data? i would love that option, but i don't don't know vbs.
Brian Flieck
flieckster
 
Posts: 38
Joined: Tue Dec 25, 2007 3:51 am
Location: King of prussia PA

Postby Mike Hale » Fri Mar 14, 2008 2:03 pm

Is there a reason you want to use VBS?

You can create a bat file to run the same exiftool command. Or there are several javascript methods posted here for running exiftool.

It's just as Patrick pointed out, most of us here don't use/know VBS

Mike
Mike Hale
Site Admin
 
Posts: 4332
Joined: Fri Sep 30, 2005 10:52 pm
Location: USA

Postby flieckster » Sat Mar 15, 2008 6:19 pm

the only reason i thought of VBS is because the GUI for bridge is very slow. these reports I'm gathers are on several directory's every day. so i ll have one from directory A and then a 2nd from directory B. i just figured it would speed up the process if it was VBS but since i have no VBS skill then i guess its not an option.

the csv script listed works great the only thing its missing is a collum for "current date" then another collum that i want to hard code in the "vendors name" for each report. how do i add that?
Brian Flieck
flieckster
 
Posts: 38
Joined: Tue Dec 25, 2007 3:51 am
Location: King of prussia PA

Postby Mike Hale » Sun Mar 16, 2008 2:48 pm

Unless I misunderstood what you wanted by 'current date', that is the first data item although the header just says date. You can edit that if you like.

Vednor is easy. Below is a version that prompts for the vendor name. You can move it if it's not where you want it.

Mike

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");
      var vendor = prompt("Vendor");
      if ( !f ) { return; }
      f.open("w");
      f.writeln("Date,Vendor,Name,Source,Credit,Width,Height,Resolution");
      var items = app.document.visibleThumbnails;
      for (var i = 0; i < items.length; ++i) {
         var item = items[i];
         f.writeln(tDay,',',vendor,',',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;
}
Mike Hale
Site Admin
 
Posts: 4332
Joined: Fri Sep 30, 2005 10:52 pm
Location: USA

Postby flieckster » Tue Mar 18, 2008 12:24 am

getting there.
a few other questions.
is it possible to have a drop down of "vendor names" also the date, is it possible to gather "current date" but still pop up and ask so if you want to change it you can? and last but not least, is it possible for it say when its done its run? as it is now its hard to tell when its done.

thank you again for all you help.
Brian Flieck
flieckster
 
Posts: 38
Joined: Tue Dec 25, 2007 3:51 am
Location: King of prussia PA

Next

Return to Adobe Bridge Scripting: General Discussion

Who is online

Users browsing this forum: No registered users and 0 guests