Split out a portion of ctdl_getscript() into a new function get_active_script() becau...