Can I copy IPTC 'headlines' into my iptc 'captions' in some sort of batch process?

flickerbrown

TPF Noob!
Joined
Jul 20, 2010
Messages
5
Reaction score
0
Location
Medford, MA / New Rochelle, NY
Can others edit my Photos
Photos NOT OK to edit
Apparently lightroom (2.7) doesn't include the iptc 'headline' as one of the fields that can output on a printout contact sheet or anything like that... kind of puzzling. Does anyone know if I can copy the headlines of my photos into their (blank) caption fields in a batch process without creating a workflow that opens DNGs as text files and does all sorts of text finding/replacing?
 
If you have Photoshop you should be able to do this with a simple script and Bridge.
 
This example is for Photoshop CS3 or better!
Copy and paste the code into ExtendScript Toolkit
This utility can be found in the relevant folder:-
PC: C:\Program Files\Adobe\Adobe Utilities
MAC: <hard drive>/Applications/Utilities/Adobe Utilities
Or you can use a text editor and save with an extension of .jsx
Start Bridge
Edit - Preferences - Startup Scripts
At the bottom click the "Reveal Button" this will open the folder where the script should be placed.
Place the file into this folder.
Close and restart Bridge.
Accept the new script.
To use:-
Navigate to the required folder
Select the documents to be processed
Mouse right click menu ( Control-click on a Mac) and select "Copy Headline to Caption"
That's all there is to it :)



#target bridge
if( BridgeTalk.appName == "bridge" ) {
headToCap = MenuElement.create("command", "Copy Headline to Caption", "at the end of Thumbnail");
}
headToCap.onSelect = function () {
headLineToCaption();
}
function headLineToCaption(){
if (ExternalObject.AdobeXMPScript == undefined) ExternalObject.AdobeXMPScript = new ExternalObject("lib:AdobeXMPScript");
var thumb = app.document.selections;
for(var s in thumb){
if(!thumb.hasMetadata) continue;
var selectedFile = thumb.spec;
var myXmpFile = new XMPFile( selectedFile.fsName, XMPConst.UNKNOWN, XMPConst.OPEN_FOR_UPDATE);
var myXmp = myXmpFile.getXMP();
var Head = myXmp.getProperty(XMPConst.NS_PHOTOSHOP, "Headline");
//REMOVE THE LINE BELOW IF YOU WANT TO KEEP THE SAME DETAILS IN THE Headline !!!!!!!!
myXmp.deleteProperty(XMPConst.NS_PHOTOSHOP, "Headline");
myXmp.deleteProperty(XMPConst.NS_DC, "description");
myXmp.setLocalizedText( XMPConst.NS_DC, "description", null, "x-default", Head );
if (myXmpFile.canPutXMP(myXmp)) {
myXmpFile.putXMP(myXmp);
myXmpFile.closeFile(XMPConst.CLOSE_UPDATE_SAFELY);
} else {
xmpFile.closeFile();
}
}
}
 
This example is for Photoshop CS3 or better!
Copy and paste the code into ExtendScript Toolkit
This utility can be found in the relevant folder:-
PC: C:\Program Files\Adobe\Adobe Utilities
MAC: <hard drive>/Applications/Utilities/Adobe Utilities
Or you can use a text editor and save with an extension of .jsx
Start Bridge
Edit - Preferences - Startup Scripts
At the bottom click the "Reveal Button" this will open the folder where the script should be placed.
Place the file into this folder.
Close and restart Bridge.
Accept the new script.
To use:-
Navigate to the required folder
Select the documents to be processed
Mouse right click menu ( Control-click on a Mac) and select "Copy Headline to Caption"
That's all there is to it :)



#target bridge
if( BridgeTalk.appName == "bridge" ) {
headToCap = MenuElement.create("command", "Copy Headline to Caption", "at the end of Thumbnail");
}
headToCap.onSelect = function () {
headLineToCaption();
}
function headLineToCaption(){
if (ExternalObject.AdobeXMPScript == undefined) ExternalObject.AdobeXMPScript = new ExternalObject("lib:AdobeXMPScript");
var thumb = app.document.selections;
for(var s in thumb){
if(!thumb.hasMetadata) continue;
var selectedFile = thumb.spec;
var myXmpFile = new XMPFile( selectedFile.fsName, XMPConst.UNKNOWN, XMPConst.OPEN_FOR_UPDATE);
var myXmp = myXmpFile.getXMP();
var Head = myXmp.getProperty(XMPConst.NS_PHOTOSHOP, "Headline");
//REMOVE THE LINE BELOW IF YOU WANT TO KEEP THE SAME DETAILS IN THE Headline !!!!!!!!
myXmp.deleteProperty(XMPConst.NS_PHOTOSHOP, "Headline");
myXmp.deleteProperty(XMPConst.NS_DC, "description");
myXmp.setLocalizedText( XMPConst.NS_DC, "description", null, "x-default", Head );
if (myXmpFile.canPutXMP(myXmp)) {
myXmpFile.putXMP(myXmp);
myXmpFile.closeFile(XMPConst.CLOSE_UPDATE_SAFELY);
} else {
xmpFile.closeFile();
}
}
}

Hi Paul!
Can you please give me the reverse script for this as in copy Description to Headline
I tried to make it work myself but with no succes:hail:
 
Here you are ...

#target bridge
if( BridgeTalk.appName == "bridge" ) {
descToHead = MenuElement.create("command", "Description to Headline", "at the end of Thumbnail");
}
descToHead.onSelect = function () {
CaptionToHeadline();
}
function CaptionToHeadline(){
if (ExternalObject.AdobeXMPScript == undefined) ExternalObject.AdobeXMPScript = new ExternalObject("lib:AdobeXMPScript");
var thumb = app.document.selections;
for(var s in thumb){
if(!thumb.hasMetadata) continue;
var selectedFile = thumb.spec;
var myXmpFile = new XMPFile( selectedFile.fsName, XMPConst.UNKNOWN, XMPConst.OPEN_FOR_UPDATE);
var myXmp = myXmpFile.getXMP();
var Desc = getArrayItems(XMPConst.NS_DC, "description");
myXmp.deleteProperty(XMPConst.NS_DC, "description");
myXmp.deleteProperty(XMPConst.NS_PHOTOSHOP, "Headline");
myXmp.setProperty(XMPConst.NS_PHOTOSHOP, "Headline", Desc);
if (myXmpFile.canPutXMP(myXmp)) {
myXmpFile.putXMP(myXmp);
myXmpFile.closeFile(XMPConst.CLOSE_UPDATE_SAFELY);
} else {
xmpFile.closeFile();
}
}
function getArrayItems(ns, prop){
var arrItem=[];
var items = myXmp.countArrayItems(ns, prop);
for(var i = 1;i <= items;i++){
arrItem.push(myXmp.getArrayItem(ns, prop, i));
}
return arrItem.toString();
}
}
 

Most reactions

Back
Top