View Single Post
Fire up the Script Editor, which can be found in the Applescript folder in your Applications Folder. Paste in the code, then save it in Library/Scripts/Applications/OmniFocus (you'll have to create the OmniFocus folder) with some appropriate name. You can then install it as a toolbar button in OmniFocus, or invoke it from the Applescript menu (which you need to turn on if you want it with Applescript Utility, in that same folder), or invoke it from a Mail rule (what you'll want to do in this case).