Appearently updated to AppleScript 1.8.3 breaks my script, so here is the updated version that is compatible with the lastest AppleScript
System Requirement: Mac OS X 10.1.5 and AppleScript 1.8.3 with Developer Tools installed.
AppleScript 1.8.3 is available via Software Update.