I have made a quick macro, which uses Peters shell commands:
I am sure somebody can optimize it.
For more information, see the wiki Searching the Forum for Answers section.