title: Google apps script rename file not working
body: <p>When running this script I get the error 
  TypeError: Cannot find function setName in object File. (line 8, file "Code")</p>
  
  <pre><code>function rename() {
    var folder = DocsList.getFolder('Folder');
    var files = folder.getFiles();
    for (var i in files) {
      oldName = files[i].getName()
      newName = oldName.replace(/\d+/g, '')
      newName = newName.replace(/\s/g, '');
      files[i].setName(newName)
  
    }
  </code></pre>