Deleteing files x number of days old

Been thinking - Is there a way you could script using the Delete Filter so you can put it on a button?

Would be a lot easier I think once its been written.