Lifehacker has been raving about autohotkey for ever, of course. Today I finaly got around to doing my first ever autohotkey script. This one is for binding F5 to close and reopen in the excellent Foxit Reader:
SetTitleMatchMode, 2
#IfWinActive Foxit
F5::
Send ^w
Send !f1
return