How to automatically load the Readbility version of a page?

There’s a script to convert any web page to its Readability version using javascript. In DT, it’s as follows:

tell application id "com.devon-technologies.thinkpro2"
	do JavaScript "(function(){readStyle='style-newspaper';readSize='size-medium';readMargin='margin-medium';_readability_script=document.createElement('SCRIPT');_readability_script.type='text/javascript';_readability_script.src='http://lab.arc90.com/experiments/readability/js/readability.js?x='+(Math.random());document.getElementsByTagName('head')[0].appendChild(_readability_script);_readability_css=document.createElement('LINK');_readability_css.rel='stylesheet';_readability_css.href='http://lab.arc90.com/experiments/readability/css/readability.css';_readability_css.type='text/css';_readability_css.media='screen';document.getElementsByTagName('head')[0].appendChild(_readability_css);_readability_print_css=document.createElement('LINK');_readability_print_css.rel='stylesheet';_readability_print_css.href='http://lab.arc90.com/experiments/readability/css/readability-print.css';_readability_print_css.media='print';_readability_print_css.type='text/css';document.getElementsByTagName('head')[0].appendChild(_readability_print_css);})();" in think window 1
end tell

But when I try to turn this into a ‘triggered’ script, ie one that loads every time the page loads, it doesn’t work. Or perhaps I’m not doing it right. What seemed to work in other cases is wrapping a script like that above with

on triggered(theRecord)
	try

above it, and

	end try
end triggered

beneath it. How do I tweak this to make it work?

Here’s a PHP port of Readability. I’ve no idea how to apply it, though: http://www.keyvan.net/2010/08/php-readability/