• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Batch Keyword Delete

New Here ,
Jan 22, 2020 Jan 22, 2020

Copy link to clipboard

Copied

I imported some photos that have keywords in the Metadata. Is there a way to batch delete all keywords from a selection of photographs. I don't want to open each of the hundreds of photos to delete the keywords in the metadata.

Thanks

TOPICS
Batch , How to , Keywords , Metadata

Views

1.0K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 23, 2020 Jan 23, 2020

Copy link to clipboard

Copied

Select all and use the Keyword panel to uncheck the keywords you want removed.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 23, 2020 Jan 23, 2020

Copy link to clipboard

Copied

If you wish to remove all keywords from all selected images, you could use a script:

 

 

 

//forums.adobe.com/thread/290238
//forums.adobe.com/message/1115698#1115698
#target bridge
clearSubKey = {};// create an object
clearSubKey.execute = function(){// create a method for that object
  var sels = app.document.selections;// store the array of selected files
  for (var i = 0; i < sels.length; i++){//loop though that array
    var md = sels[i].synchronousMetadata;// get the metadata for the file
     md.namespace = "http://ns.adobe.com/photoshop/1.0/";// set the namespace
     md.Keywords = "";//set the porperty
  }
}
// this script only works in bridge
if (BridgeTalk.appName == "bridge"){
  //creage the munuItem
  var menu = MenuElement.create( "command", "Clear Subject Keywords Metadata", "at the end of Tools");
  menu.onSelect = clearSubKey.execute;
}

 

 

 

This modified version of the previous script will also remove all Adobe Lightroom hierarchicalSubject keywords:

 

 

 

//forums.adobe.com/thread/290238
//forums.adobe.com/message/1115698#1115698
#target bridge
clearLHS = {};// create an object
clearLHS.execute = function(){// create a method for that object
  var sels = app.document.selections;// store the array of selected files
  for (var i = 0; i < sels.length; i++){//loop though that array
    var md = sels[i].synchronousMetadata;// get the metadata for the file
     md.namespace = "http://ns.adobe.com/lightroom/1.0/","hierarchicalSubject";// set the namespace
     md.hierarchicalSubject = "";//set the porperty
  }
}
// this script only works in bridge
if (BridgeTalk.appName == "bridge"){
  //creage the munuItem
  var menu = MenuElement.create( "command", "Clear Lr hierarchicalSubject Keywords Metadata", "at the end of Tools");
  menu.onSelect = clearLHS.execute;
}

 

 

 

P.S. I have not combined the two scripts into one, which would be the next logical step (editing the code to combine the two scripts is proving to be harder than expected)...

 

https://prepression.blogspot.com/2017/11/downloading-and-installing-adobe-scripts.html

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 24, 2020 Jan 24, 2020

Copy link to clipboard

Copied

LATEST

My Keyword Optimizer deletes keywords before rewriting them. However, they are in dc:subject, I am not working with the Photoshop namespace. There is also a MicrosoftPhoto namespace that can store keywords.

 

 

var kwList = app.document.selections;

var i = 0;
if (ExternalObject.AdobeXMPScript == undefined) ExternalObject.AdobeXMPScript = new ExternalObject('lib:AdobeXMPScript');
for(i = 0; i < kwList.length; i++){ //loop through selected files
if(kwList[i].hasMetadata){ //only process files with metadata

var md = kwList[i].synchronousMetadata;
var xmp = new XMPMeta(md.serialize());
//delete old keywords in both namespaces
XMPUtils.removeProperties(xmp, XMPConst.NS_DC, 'subject', XMPConst.REMOVE_ALL_PROPERTIES);
XMPUtils.removeProperties(xmp, 'http://ns.adobe.com/lightroom/1.0/', 'hierarchicalSubject', XMPConst.REMOVE_ALL_PROPERTIES);

}

}

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines