CSV Data Collector

Upload Adobe Bridge Scripts, Download Adobe Bridge Scripts, Support for Individual Adobe Bridge Scripts

Moderators: Tom, Kukurykus

Paul MR

CSV Data Collector

Post by Paul MR »

Thanks for that Mike, hope it's ok to post this modified script? I have put everything into one script and it works fine in CS5.
darthpixel

CSV Data Collector

Post by darthpixel »

The script is awesome, but may not be what I am really looking for. I need a CSV dump based on Name, Size, Dimensions, Resolution, Type and Date Modified...these are the only columns I view in Bridge and need to provide to our end users for a asset library. It would be sweet to just have the data in the table shown in Bridge dumped into a file. Is this possible? Or should I be looking for a different type of script?

I see the BarredRock script listed above provides Name as needed. The rest of the file attributes require some sort of post data dump fiddling. Dimensions (Image Width and Image Length) need to be reformatted into a single field format of X x Y...which isn't a deal breaker. Resolution may be gleaned from one of the XResolution or YResolution Metedata selections...again, not awful, but just another thing to have to mess with.

I don't see a selection for file size, file type or date modified...did I miss these somewhere? I understand that some of these schema apply to digital photo info only and thus would not provide file type or date modified as it would not be needed.

This script would also run across PSD, JPG, TIFF files as well as MOV, MP4 and a few other video formats...any thoughts on that?

Any help in addition to the great info you all have posted up to now would be appreciated!
Paul MR

CSV Data Collector

Post by Paul MR »

Maybe something like the attached script might work for you..
I don't know if it will work on some of the video files, it all depends if they have metadata.
lmgotera

CSV Data Collector

Post by lmgotera »

Thanks all for this script. I have been scouring the internet for nearly a day to find exactly this.

I've never coded java or jsx before but I am familiar with php and xml. I've been trying to modify the custom script posted last here to show these values:

DateTimeOriginal
FNumber
file size

I believe this script is drilling down through:

app.document.selections.core.quickMetadata.[width] where [value] is the targeted data.

I haven't been able to locate a syntax reference for how to extract EXIF values. Can one of you point me in the right direction please?

Thanks,
Laurie
Paul MR

CSV Data Collector

Post by Paul MR »

Welcome to PS Scripts Laurie.
The file size is allready in that script, I have added your two new fields so you can see one way of doing it..

Code: Select all#target bridge 
if( BridgeTalk.appName == "bridge" ) { 
var Menua = new MenuElement( "menu", "FileInfo", "after Help", "customMeta" );
var MenuaCommand = new MenuElement( "command", "Custom Metadata", "at the end of customMeta" , "xx1a" );
}
MenuaCommand.onSelect = function () {
     getFileDetails();
     }
function getFileDetails(){
var TimeNow = new Date();
var hours = TimeNow.getHours();
var minutes = TimeNow.getMinutes();
var seconds = TimeNow.getSeconds();
if (hours > 12) hours = hours - 12;
if (hours == 0) hours = 12;
if (minutes <= 9) minutes = "0" + minutes;
if (seconds <= 9) seconds = "0" + seconds;
var TodaysTime = "_" + hours + "-" + minutes + "-"+seconds;
var f = Folder.desktop + "/" + decodeURI(Folder(app.document.presentationPath).name)  +TodaysTime.toString() + ".csv";
var file = new File(f);
var sels = app.document.selections;
if(sels.length < 1) return;
file.open("w", "TEXT", "????");
file.encoding = "UTF-8";
$.os.search(/windows/i)  != -1 ? file.lineFeed = 'windows'  : file.lineFeed = 'macintosh';
file.writeln("Name,File Size,Width,Height,Resolution,Type,F Number,Date Modified,DateTimeOriginal");
for(var a in sels){
if(sels[a].type != "file") continue;
app.synchronousMode = true;
sels[a].core.preview.preview;
app.synchronousMode = false;
var md = sels[a].synchronousMetadata
md.namespace = "http://ns.adobe.com/exif/1.0/";

var line ='';
line +=sels[a].name + ",";
line += File(sels[a].spec).length + ","; //this is the filesize in bytes
line +=  sels[a].core.quickMetadata.width + ",";
line +=  sels[a].core.quickMetadata.height + ",";
//Note if resolution does not exist it will show as 0
line +=  sels[a].core.quickMetadata.xResolution + ",";
line += sels[a].name.match(/\..+$/).toString().replace(/\./,'') + ",";
var FN = md.FNumber.split('/');
var Fnumber = Number(FN[0])/Number(FN[1]);
line += "F"+ Fnumber + ",";
line += File(sels[a].spec).modified + ",";
line += md.DateTimeOriginal;
file.writeln(line);
    }
file.close();
alert("CSV file created on the desktop ... " + file.name);
}
lmgotera

CSV Data Collector

Post by lmgotera »

Thanks Paul,

That was exactly what I needed. I never would have guessed at that syntax without your help.

Can you help me modify it to search through sub folders as well please?

Laurie