Script : How to add a progress bar to XMP Writing script ?
Hi !
I have this script that works flawlessly but when i execute it on big video files ( > 1GB) bridge doesn't repaint and it looks like it's stuck. I would like to have a progress bar showing % remaining on the task and the name of the file being treated. Can someone point me into the right direction as my adobe scripting knowledge is not that great.
#target bridge
if( BridgeTalk.appName == "bridge" ) {
descToTitle = MenuElement.create("command", "Log Comment to Description", "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 LogComment = myXmp.getProperty(XMPConst.NS_DM, "logComment");
myXmp.deleteProperty(XMPConst.NS_DC, "description");
myXmp.appendArrayItem(XMPConst.NS_DC, "description", LogComment, 0, XMPConst.ALIAS_TO_ALT_TEXT);
myXmp.setQualifier(XMPConst.NS_DC, "description[1]", "http://www.w3.org/XML/1998/namespace", "lang", "x-default");
}
if (myXmpFile.canPutXMP(myXmp)) {
myXmpFile.putXMP(myXmp);
myXmpFile.closeFile(XMPConst.CLOSE_UPDATE_SAFELY);
} else {
xmpFile.closeFile();
}
}
}
Thx in advance for helping me !
