title: Copy template spreadsheet to folder, then write to the new copy (google script)
body: <p>I need to copy a template spreadsheet to a folder, then write to C3 in the new copy. </p>
  
  <pre><code>//get template 
  var SStemplate = "URL here";
  var SStocopy = SpreadsheetApp.openByUrl(SStemplate); 
  
  //set destination folder
  var SSdestFolder = DriveApp.getFolderById("0B-hjh1DycmoweEl5ZmgxdFBRYzg");
  
  //copy template to destination 
  DriveApp.getFileById(SStocopy.getId()).makeCopy(name, SSdestFolder);
  </code></pre>
  
  <p>Once I have created the copy, how do I activate it in order to set the value of cell C3?</p>
  
  <p>Here's the final working version:</p>
  
  <pre><code>function newprojectdocuments(){     
  //activate current sheet to get new project ID
  var trackerss = SpreadsheetApp.getActiveSpreadsheet();
  var sheet = trackerss.getSheetByName('AutoTracker');
  var range = sheet.getRange('F1:F1');
  var foldername = range.getValues();
  
  if( foldername.toString().length === 7 ){       
  //get template spreadsheet to make copy
  var SStemplate = "url";
  var SStocopy = SpreadsheetApp.openByUrl(SStemplate);  
  //set destination folder for new project spreadsheet
  var SSdestFolder = DriveApp.getFolderById("ID");    
  //copy template to the spreadsheet folder
  var newFile = DriveApp.getFileById(SStocopy.getId()).makeCopy(foldername, 
  SSdestFolder);  
  //open the new file
  var ss = SpreadsheetApp.openById(newFile.getId());
  var sheet = ss.getSheetByName('Overview');
  //Write the value you want in C3 cell
  sheet.getRange("C3").setValue(foldername);
  //create new folder in deal documents folder
  var dealfolder=DriveApp.getFolderById("ID");
  var newfolder=dealfolder.createFolder(foldername)  
  if( foldername.toString().length === 7 ){
  Browser.msgBox( "Project " + foldername + " folder &amp; spreadsheet created! 
  Refresh the tracker to display."  )
   }
   } else {
  Browser.msgBox('Project ID must be 7 digits: YYMMDDN format') 
  } 
  }
  </code></pre>