Creating optimization tasks using a script