1.将下面这段代码复制粘贴到文本工具当中,另存为后缀名为Jsx格式文件,比如“PSD瘦身.jsx”。
2.然后PS打开有元数据的PSD文件,执行「文件」——「脚本」——「浏览...」,选择保存的 Jsx格式文件“PSD瘦身.jsx”,即可解决该问题。
function deleteDocumentAncestorsMetadata() (//String version of the app namewhatApp =String(app.name);
// Check for photoshop specifically, or this will cause
errors
if(whatApp.search("Photoshop") > 0) [
// Function Scrubs Document Ancestors from Files
if(Idocuments.length) (
alert("There are no open documents. Please open a
file to run this script.")
return;
)
if (ExternalObject.AdobeXMPScript == undefined) Ex
ternalObject.AdobeXMPScript = new ExternalObject
ExternalObject("lib:AdobeXMPScript");
var xmp = new XMPMetaXMPMeta( activeDocumen
t.xmpMetadata.rawData);
// Begone foul Document Ancestors!
xmp.deleteProperty(XMPConst.NS_PHOTOSHOP,
"DocumentAncestors");
app.activeDocument.xmpMetadata.rawData=xmp.
serialize();
)
)
// Now run the function to remove the document an
cestors
deleteDocumentAncestorsMetadata();
(所有的(修改为{})