Looking for google-apps-script Answers? Try Ask4KnowledgeBase
Looking for google-apps-script Keywords? Try Ask4Keywords

google-apps-script Create new file in Google Drive of a certain Mime type


 function createGoogleDriveFileOfMimeType() {
  var content,fileName,newFile;//Declare variable names
  fileName = "Test File " + new Date().toString().slice(0,15);//Create a new file name with date on end
  content = "This is the file Content";

  newFile = DriveApp.createFile(fileName,content,MimeType.JAVASCRIPT);//Create a new file in the root folder