Handler for executing scripts