supports gen_local_scripts.m with a start index