2 Replies Latest reply on Jun 23, 2012 10:53 AM by Michael L Hale

    Script to erase all meta data?

    brodie_geers

      I'm looking for a script that will erase all meta data from an image that I can put in the event manager to run whenever I save. 

       

       

      I work with renderings, not photos, and some of my software inserts a lot of meta data that is interfering with other people in the pipeline.

       

       

      Is this possible through a PS script?

       

       

      -Brodie

        • 1. Re: Script to erase all meta data?
          Paul Riggott Level 6

          Not really as some schemas are read only.

           

          This code will remove all that can be removed...

           

          if (ExternalObject.AdobeXMPScript == undefined)  ExternalObject.AdobeXMPScript = new ExternalObject("lib:AdobeXMPScript");
          xmp = app.activeDocument.xmpMetadata.rawData;
          xmpObject = new XMPMeta(xmp);
          XMPUtils.removeProperties(xmpObject, "", "", XMPConst.REMOVE_ALL_PROPERTIES);
          app.activeDocument.xmpMetadata.rawData = xmpObject.serialize();
          
          
           

           

          If you wanted to remove all data, you would have to export as Save for Web making sure no metadata is selected; or create a new document by selecting all layers and duplicate them to a new document. Do not just duplicate the document as this will retain the metadata.

          • 2. Re: Script to erase all meta data?
            Michael L Hale Level 5

            Should note some are read-only to XMP. There are some apps like Exiftool that can remove much more metadata that Photoshop can. Exiftool can remove camera data for example while Photoshop can not.