I tried your code, Hans, and it seems to work fine for me (IDCS4 under 64-bit Win7). Thank you very much.
There are a number of reasons for stripping out some XMP multimedia metadata: I was startled to find, like Giordano, that IDCS4 templates were preserving a lot of useless material and bloating my PDFs. The excess baggage also prevents compliance with PDF/A, as Dave Merchant describes over on the . Versions of Acrobat before XI could not strip the junk out, as he details in his blog, where he also provides a script to purge the material. As I wrote over on the ID forum , I took to editing INX files exported from my IDCS4 templates, and zapping the XMP categories named in Dave's JS script: INX are simpler than IDML, and for me to do this by hand the process was not much slower than going down the hall and firing up the IDCS5.5 machine for round-trip cleansing. Your ID JSX doesn't zap all of Dave's categories, so I think I'll stick with your more conservative approach until I figure out the consequences for a work file of stripping out, say, xmpMM:Manifest.
Thanks again,
David