code_r_ssd function

Generate a script according to user in-app inputs