Q: Printing PDF to folder in Google Drive I am using a script to print a spreadsheet to PDF.I would like to print it to a location on the drive "PDF Folder". Anyone know how to do this?
Heres is my code :
function printpdf(){
  var spreadsheet_id="0AkcI3cOVJXI3dHg3Nnk3Y2JUakViTkUzQzdXSUdLNEE";
  var spreadsheetFile = DocsList.getFileById(spreadsheet_id); 
  var blob = spreadsheetFile.getAs('application/pdf'); 
  DocsList.createFile(blob);
}


A: just add it to the folder like this :
(I reproduce the whole code)
function printpdf(){
  var spreadsheet_id="0AkcI3cOVJXI3dHg3Nnk3Y2JUakViTkUzQzdXSUdLNEE";
  var spreadsheetFile = DocsList.getFileById(spreadsheet_id); 
  var blob = spreadsheetFile.getAs('application/pdf'); 
  var folder = DocsList.getFolder('PDF Folder'); //get the folder by its path
  var pdf = DocsList.createFile(blob).addToFolder(folder);
}

