For a purely Keyboard Maestro solution, see also:
For more information, see the wiki Searching the Forum for Answers section.