You can do this with a Java snippet, for any kind of file type. Here’s an example I posted a while ago:
Background:
–P