Is it possible to modify this script to include subfolders?
I have tried to do this with no luck. This script works great, but how to I make it apply to all sub-folders? Thanks for any suggestions.
#target bridge
if( BridgeTalk.appName == "bridge" ) {
descToTitle = MenuElement.create("command", "Keys to Title", "at the end of Tools");
}
descToTitle.onSelect = function () {
if (ExternalObject.AdobeXMPScript == undefined) ExternalObject.AdobeXMPScript = new ExternalObject("lib:AdobeXMPScript");
var thumb = app.document.selections;
for(var s in thumb){
if(thumb.hasMetadata){
var selectedFile = thumb.spec;
var myXmpFile = new XMPFile( selectedFile.fsName, XMPConst.UNKNOWN, XMPConst.OPEN_FOR_UPDATE);
var myXmp = myXmpFile.getXMP();
var Description = getArrayItems(XMPConst.NS_DC, "keywords");
myXmp.deleteProperty(XMPConst.NS_DC, "title");
myXmp.appendArrayItem(XMPConst.NS_DC, "title", Description, 0, XMPConst.ALIAS_TO_ALT_TEXT);
myXmp.setQualifier(XMPConst.NS_DC, "title[1]", "http://www.w3.org/XML/1998/namespace", "lang", "x-default");
}
function getArrayItems(ns, prop){
var arrItem=[];
try{
var items = myXmp.countArrayItems(ns, prop);
for(var i = 1;i <= items;i++){
arrItem.push(myXmp.getArrayItem(ns, prop, i));
}
return arrItem;
}catch(e){alert(e +" Line: "+ e.line);}
}
if (myXmpFile.canPutXMP(myXmp)) {
myXmpFile.putXMP(myXmp);
myXmpFile.closeFile(XMPConst.CLOSE_UPDATE_SAFELY);
} else {
xmpFile.closeFile();
}
}
}