This will get you started. It extracts properties from the EXIF and XMP Basic schemas from a selected thumbnail and writes the metadata to the JS console and to a file. Open the script in the ESTK and run it against Bridge with a selection made.
The info you need to modify this script to suit your needs is in the JavaScript Tools guide which you can get with the Bridge SDK from http://www.adobe.com/devnet/bridge/
// Load the XMP Script library
if( xmpLib == undefined )
{
if( Folder.fs == "Windows" )
{
var pathToLib = Folder.startup.fsName + "/AdobeXMPScript.dll";
}
else
{
var pathToLib = Folder.startup.fsName + "/AdobeXMPScript.framework";
}
var libfile = new File( pathToLib );
var xmpLib = new ExternalObject("lib:" + pathToLib );
}
// Get a selected thumbnail
var thumb = app.document.selections[0];
if(thumb.hasMetadata)
{
// Get the selected file
var selectedFile = thumb.spec;
// Create an XMPFile - this allows you to extract the XMP data
var myXmpFile = new XMPFile( selectedFile.fsName, XMPConst.UNKNOWN, XMPConst.OPEN_FOR_READ);
// The XMP object from the selected thumb
var thumbXMP = myXmpFile.getXMP();
// An empty XMP object
var myXMP = new XMPMeta();
// Create an iterator that will only visit EXIF properties
var iter = thumbXMP.iterator(0, XMPConst.NS_EXIF);
while((prop = iter.next()) != null)
{
if(prop.path != "")
{
//$.writeln(prop.namespace + " " + prop.path + " " + prop.value, prop.options);
myXMP.setProperty(prop.namespace, prop.path, prop.value, prop.options);
}
}
// Create an iterator that will only visit XMP Basic properties
iter = thumbXMP.iterator(0, XMPConst.NS_XMP);
while((prop = iter.next()) != null)
{
if(prop.path != "")
{
//$.writeln(prop.namespace + " " + prop.path + " " + prop.value, prop.options);
myXMP.setProperty(prop.namespace, prop.path, prop.value, prop.options);
}
}
var myXMPPacket = myXMP.serialize (XMPConst.SERIALIZE_OMIT_PACKET_WRAPPER);
$.writeln(updatedPacket);
var outFile = File(thumb.spec.fsName + ".xml");
outFile.open("w");
outFile.write(myXMPPacket);
outFile.close();
}