Welcome to Photoshop Gurus forum. Register a free account today to become a member! It's completely free. Once signed in, you'll enjoy an ad-free experience and be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!
exiftool -m -overwrite_original_in_place -EXIF:ImageDescription= -XMP:dc:Description= -IPTC:Caption-Abstract= [DIR]
function deleteUnwantedMetadata() {
whatApp = String(app.name);
if(whatApp.search("Photoshop") > 0) {
if(!documents.length) {
alert("No open documents. Open a file to run script.")
return;
}
if (ExternalObject.AdobeXMPScript == undefined) ExternalObject.AdobeXMPScript = new ExternalObject("lib:AdobeXMPScript");
var xmp = new XMPMeta( activeDocument.xmpMetadata.rawData);
xmp.deleteProperty(XMPConst.NS_PHOTOSHOP, "DocumentAncestors");
if (xmp.doesArrayItemExist(XMPConst.NS_DC, "description", 1))
{
xmp.deleteArrayItem(XMPConst.NS_DC, "description", 1);
}
app.activeDocument.xmpMetadata.rawData = xmp.serialize();
}
}
deleteUnwantedMetadata();
PSD, PSB and JPG: 3 of the 4 fields ([EXIF]ImageDescription, [IPTC]Caption-Abstract and [XMP-Photoshop]DocumentAncestors) are cleared as I'd like. However, for these image formats, the data that was once in [EXIF]ImageDescription is now in [XMP-dc]Description.
I noticed that if I open the PSD, PSB and JPG files a second time and run through the script, then everything gets cleared out on these files as well.xmp.setLocalizedText(XMPConst.NS_DC, "description", null, "x-default", " "); below xmp.deleteArrayItem(XMPConst.NS_DC, "description", 1);. above, this will at least clear everything out and just include a space for the field, but would rather have the filed empty if possible (null doesn't appear to work here).