I have a script that creates a new (and deletes the old) google document.
function copyTemplate() { var form1 = DriveApp.getFilesByName('Form for dentist').next(); formUrl = form1.getUrl(); var formSome = FormApp.openByUrl(formUrl); var copyOfFile = DriveApp.getFilesByName('statement_copy'); while (copyOfFile.hasNext()) { var file = copyOfFile.next(); DriveApp.removeFile(file); } newFile = DriveApp.getFilesByName('template').next().makeCopy('statement_copy'); urlNew = newFile.getUrl(); var docFile = DocumentApp.openByUrl(urlNew); formSome.setConfirmationMessage(urlNew); } But this script works for a very long time. And sometimes I need to send the data from the form directly to this file (which is being created). Is it possible to make it so that the form cannot be sent until the file is created on the disk?