The following code is designed to take a specific option selected on a Google Form and use that to determine where something could be stored. The example it was developed for was Risk Assessments where depending on the type of assessment selected on the Form the generated file was to be saved in a specific Google Drive folder.
Source: The Gift of Script: Google Form – use a switch to determine save location
I use Google Apps Script to support staff and students in my job. I enjoy dabbling with creating tools to help with automation and I freely share my learning experiences on my blog: www.pbainbridge.co.uk