New version of the script handler.