Skip to main content
Participant
May 23, 2008
Question

Export Caption and Keywords and Filenames into an Excel Document

  • May 23, 2008
  • 1 reply
  • 608 views
I honestly have no idea about 'scripting', but it sounds amazing. Having a folders' metadata in a excel file would be SO useful.

I tried to download a script, but it didnt work, I did exactly what it said (put it in startupscripts folder in /adobe) and opened bridge, but the option wasnt in the tools menu as it said it would be.

How does one obtain scripts? Is there somewhere reputable that people get them from or are they all self written?
This topic has been closed for replies.

1 reply

Paul Riggott
Inspiring
June 23, 2008
Most people write thier own. This might do the job for you.<br />Start Bridge<br />Edit - Preferences - Startup Scripts - Click the 'Reveal' button<br />and place this script in that folder.<br />File name convention CS2/CS3 is FileName.jsx<br />Close and restart Bridge and the option should then be available at the bottom of the menu when you right click.<br />Paul.<br /><br />#target bridge <br /> if( BridgeTalk.appName == "bridge" ) { <br />csvData = new MenuElement("command", "Export CSV Data", "at the end of Thumbnail");<br />}<br />csvData.onSelect = function () { <br /> main();<br /> }<br />function main(){<br />var dlg =<br />"dialog{text:'Script Interface',bounds:[100,100,500,240],"+<br />"panel0:Panel{bounds:[10,10,390,130] , text:'' ,properties:{borderStyle:'etched',su1PanelCoordinates:true},"+<br />"statictext0:StaticText{bounds:[10,10,250,30] , text:'Please Select Folder For CSV File' ,properties:{scrolling:undefined,multiline:undefined}},"+<br />"edittext0:EditText{bounds:[10,30,290,50] , text:'' ,properties:{multiline:false,noecho:false,readonly:false}},"+<br />"button0:Button{bounds:[300,30,370,51] , text:'Browse' },"+<br />"statictext1:StaticText{bounds:[10,60,160,80] , text:'Please Enter CSV Filename ' ,properties:{scrolling:undefined,multiline:undefined}},"+<br />"edittext1:EditText{bounds:[170,60,370,80] , text:'' ,properties:{multiline:false,noecho:false,readonly:false}},"+<br />"button1:Button{bounds:[10,90,180,110] , text:'Ok' },"+<br />"button2:Button{bounds:[200,90,370,110] , text:'Cancel' }}}";<br /><br />var win = new Window(dlg, "Metadata 2 CSV");<br />win.center();<br /> win.panel0.edittext0.enabled=false;<br /> <br /> win.panel0.button0.onClick = function() { <br /> var selectedFolder = Folder.selectDialog( "Please select folder"); <br /> if(selectedFolder != null)<br /> win.panel0.edittext0.text = decodeURI(selectedFolder.fsName); <br />}<br />var done = false; <br /> while (!done) { <br /> var x = win.show(); <br /> if (x == 0 || x == 2) {<br /> win.canceled = true;<br /> done = true; <br /> } else if (x == 1) { <br /> done = true; <br /> var result = valiDate();<br /> if(result != true) {<br /> alert(result);<br /> return;<br /> }else<br /> { <br /> getCSVData(win.panel0.edittext0.text + '/' + win.panel0.edittext1.text );<br /> }<br /> } <br /> } <br />function valiDate(){<br />if (win.panel0.edittext0.text == '') return "No Folder Selected";<br />if (win.panel0.edittext1.text == '') return "No CSV Selected";<br />var CSV = win.panel0.edittext1.text.substring(win.panel0.edittext1.text.length -4);<br />if(CSV != '.csv' ) return "CSV Filename must have a \'.csv\' extension ";<br />return true;<br /> }<br />}<br /><br />function getCSVData(csvFile){<br />var f = new File(csvFile);<br />f.open('w');<br />var items = app.document.visibleThumbnails;<br />var items2 = new Array; <br /> for (var a =0; a<items.length;a++){<br /> if(items.type == "file") items2.push(items);<br /> }<br />items = items2;<br />for (var i = 0; i < items.length; ++i) { <br /> var item = items; <br /> f.writeln(item.path + ","+ListMetadata(item)); <br /> } <br />f.close();<br />}<br /><br />function ListMetadata(tn) { <br />md = tn.metadata; <br />md.namespace = "http://purl.org/dc/elements/1.1/"; <br />var Str = md.description + ',';<br />md.namespace = "http://ns.adobe.com/photoshop/1.0/"; <br />Str += md.Keywords + '\r';<br />return Str;<br />}