Skip to main content
PECourtejoie
Community Expert
Community Expert
March 18, 2021
Answered

Metadata template bug with keywords?

  • March 18, 2021
  • 4 replies
  • 510 views

Hi, I noticed that in 11.0.1, windows, if multiple keywords are added from a template, they will be merged inside quotes:

If I try to add Keyword1 and Keyword2 in a metadata template, they will show up  as "Keywork1; Keyword2" instead of keyword1; keyword2, once added to a file.

This works regardless if I'm picking up the 2 KWs from a file, or writing them down with the ; in between.

 

Will try on Mac, did anyone notice it? I have started a uservoice thread on the topic.

This topic has been closed for replies.
Correct answer Stephen Marsh

https://community.adobe.com/t5/bridge/remove-quotations-around-keywords/m-p/9540166

 

// https://forums.adobe.com/thread/2415320
// https://community.adobe.com/t5/bridge/remove-quotations-around-keywords/m-p/9540166
#target bridge
if( BridgeTalk.appName == "bridge" ) {
sepkeys = MenuElement.create("command", "Seperate Keywords", "at the end of Tools");
}
sepkeys.onSelect = function () {
var thumbs = app.document.selections;
if (ExternalObject.AdobeXMPScript == undefined) ExternalObject.AdobeXMPScript = new ExternalObject("lib:AdobeXMPScript");
var FolderName = decodeURI(Folder(app.document.presentationPath).name);
for(var a =0;a<thumbs.length;a++){
var selectedFile = new Thumbnail(thumbs[a]);
app.synchronousMode = true;
var xmp = new XMPMeta(selectedFile.synchronousMetadata.serialize());
var keys = getArrayItems(XMPConst.NS_DC,"subject");
if(keys.length == 1){
xmp.deleteProperty(XMPConst.NS_DC,'subject');
keys = keys[0].toString().replace(/"/g,'').split(",");
for(var k in keys){
xmp.appendArrayItem(XMPConst.NS_DC, "subject", keys[k].toString(), 0,XMPConst.PROP_IS_ARRAY);
}
var newPacket = xmp.serialize(XMPConst.SERIALIZE_USE_COMPACT_FORMAT);
selectedFile.metadata = new Metadata(newPacket);
}
}
ExternalObject.AdobeXMPScript.unload();
ExternalObject.AdobeXMPScript = undefined;
function getArrayItems(ns, prop){
var arrItem=[];
var items = xmp.countArrayItems(ns, prop);
for(var i = 1;i <= items;i++){
arrItem.push(xmp.getArrayItem(ns, prop, i));
}
return arrItem;
};
};
 
 

4 replies

Legend
March 19, 2021

I have not seen this on either platform. I have Bridge set to read and write hierarchical keywords which does seem to make a difference. There is some buggy behavior between different keyword namespaces which I have bugged and I'm not sure what the correct behavior should be.

Stephen Marsh
Community Expert
Stephen MarshCommunity ExpertCorrect answer
Community Expert
March 19, 2021

https://community.adobe.com/t5/bridge/remove-quotations-around-keywords/m-p/9540166

 

// https://forums.adobe.com/thread/2415320
// https://community.adobe.com/t5/bridge/remove-quotations-around-keywords/m-p/9540166
#target bridge
if( BridgeTalk.appName == "bridge" ) {
sepkeys = MenuElement.create("command", "Seperate Keywords", "at the end of Tools");
}
sepkeys.onSelect = function () {
var thumbs = app.document.selections;
if (ExternalObject.AdobeXMPScript == undefined) ExternalObject.AdobeXMPScript = new ExternalObject("lib:AdobeXMPScript");
var FolderName = decodeURI(Folder(app.document.presentationPath).name);
for(var a =0;a<thumbs.length;a++){
var selectedFile = new Thumbnail(thumbs[a]);
app.synchronousMode = true;
var xmp = new XMPMeta(selectedFile.synchronousMetadata.serialize());
var keys = getArrayItems(XMPConst.NS_DC,"subject");
if(keys.length == 1){
xmp.deleteProperty(XMPConst.NS_DC,'subject');
keys = keys[0].toString().replace(/"/g,'').split(",");
for(var k in keys){
xmp.appendArrayItem(XMPConst.NS_DC, "subject", keys[k].toString(), 0,XMPConst.PROP_IS_ARRAY);
}
var newPacket = xmp.serialize(XMPConst.SERIALIZE_USE_COMPACT_FORMAT);
selectedFile.metadata = new Metadata(newPacket);
}
}
ExternalObject.AdobeXMPScript.unload();
ExternalObject.AdobeXMPScript = undefined;
function getArrayItems(ns, prop){
var arrItem=[];
var items = xmp.countArrayItems(ns, prop);
for(var i = 1;i <= items;i++){
arrItem.push(xmp.getArrayItem(ns, prop, i));
}
return arrItem;
};
};
 
 
Bojan Živković11378569
Community Expert
Community Expert
March 19, 2021

Do you mean when editing metadata template and adding additional keywords? I can not reproduce on Windows Bridge version 11.0.1.109

PECourtejoie
Community Expert
Community Expert
March 19, 2021

Once you add them to the files themselves. It looks right in the template, now apply them to a file, they will be grouped together. At least in 3 of our PCs.

Bojan Živković11378569
Community Expert
Community Expert
March 19, 2021

No at my side, just tested.

PECourtejoie
Community Expert
Community Expert
March 18, 2021

The problem does not exist on a Mac, with 11.0.1 that has the same additional Custom Metadata Panel (not Adobe's)