This script walks you through creating a script for QtScript, it focuses on the Header part, which can otherwise seem a little baffling at first.
Copy it into a sub-directory under config/scripts/
Update Scripts, and run.
(Fist Make a New Blank Document and position the editing cursor in it.)
You can use this, then copy to your script editor of choice or alter it to place the result on the clipboard, instead of inserting into a Tw document.
... For script listing (2011 07 23) see TW.app.updateScriptsList()
Created with the Personal Edition of HelpNDoc: Single source CHM, PDF, DOC and HTML Help creation