Skip to main content
Participant
August 9, 2015
Question

extract photo titles

  • August 9, 2015
  • 1 reply
  • 385 views

Hi,

I'd like to extract just the titles from a number of photos and then store the titles ready to export to an Excel spreadsheet. How do I write an action to do this repeatedly? Would it be in scripts or batch commands? I use Windows 7 and Bridge & Photoshop CC.

All help appreciated.

Thanks.

Trevor

This topic has been closed for replies.

1 reply

Inspiring
August 10, 2015

Okay this can be done with a Bridge script.

#target bridge  

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

TitlestoCSV = MenuElement.create("command", "Titles to CSV", "at the end of Tools");

}

TitlestoCSV.onSelect = function () {

var outputFile = new File(Folder.desktop + "/" + decodeURI(Folder(app.document.presentationPath).name) + ".csv");

outputFile.open('w');

outputFile.writeln("Name,Title");

var sels = app.document.selections;

var Meta=[];

for (var a in sels){

if(sels.type != 'file') continue;

var thumb=sels;

md = thumb.synchronousMetadata;

md.namespace =  "http://purl.org/dc/elements/1.1/";

var filename = decodeURI(thumb.name);

var title = md.title ? md.title[0] : "";

Meta.push([[filename],[title]]);

}

outputFile.writeln(Meta.join('\n'));

outputFile.close();

alert(decodeURI(outputFile.name) + " has been created on the desktop");

};

The above script should be saved with a .jsx extension and saved into the start-up folder that can be found by going to the Bridge preferences - Startup Scripts and clicking the "Reveal My Startup Scripts"

Make sure you use a PLAIN text editor.

Close and restart Bridge then accept the new script.

To use: Select the documents you want to process, go to the Tools menu and select "Titles to CSV"

Once complete an alert will tell you the file has been saved on the desktop.

The filename will be the same as the current folder name.

Onitles to C