I use this Apps Script to make backup copies of some files:
var sourceFolderId = "xxxxxx";
var sourceFolder = DriveApp.getFolderById(sourceFolderId);
var latestFiles = sourceFolder.getFiles();
var backupFolderId = "yyyyyy";
var backupFolder = DriveApp.getFolderById(backupFolderId);
while(latestFiles.hasNext()) {
var file = latestFiles.next();
file.makeCopy(backupFolder);
}
It works fine - copying all files from the source folder to the backup folder- except that if any file being copied is a "Google Apps script" file it doesn't copy it to the backup folder, it copies it to "My Drive".
I then have to move it from "My Drive" to the required folder. I can do this with a script but I can't work out why it is doing this in the first place.
I am the owner of all the files and folders.
Any ideas why?
thanks