I am new to using the Google Advanced Services; Drive API v3.
I can seem to save or move the newly created file to the folder I want. No matter what I try they always save in the same folder regardless of the parameter I pass. I also tried Drive.Files.update(but they still moved to the same folder?)?
while (files.hasNext()) {
let file = files.next()
let name = file.getName()
console.log("Processing file: " + name);
// name new google sheet file the same as source file
var newFileData = {
title: name,
mimeType: 'application/vnd.google-apps.spreadsheet'
}
// create new file in destination folder
var newFile = Drive.Files.copy(newFileData, file.getId());
console.log("New file ID: " + newFile.id)
var newFileId = newFile.id
DriveApp.getFileById(newFileId).moveTo(destinationFolder)
DriveApp.getFileById(file.getId()).moveTo(processedFolder)
I