I am trying to delete some files from google drive folder using this script it keep saying my while i run this code
"Access denied: DriveApp. (line 20, file "Code")Dismiss"
I have read so much about it on internet and already tried every solution that i saw! i enabled the permission in the script editor and in the google APIs console developer. any idea? thank you very much guys
function DeleteOldFiles() {
var Folders = new Array(
'1RnA55YH_AyPzEVmkAXkaia2iuH17Kkdl'
);
var Files;
Logger.clear();
for each (var FolderID in Folders) {
Folder = DriveApp.getFolderById(FolderID)
Files = Folder.getFiles();
while (Files.hasNext()) {
var File = Files.next();
if (new Date() - File.getLastUpdated() > 1 * 1 * 10 * 10 * 1000) {
File.setTrashed(true); // Places the file int the Trash folder
//Drive.Files.remove(File.getId()); // Permanently deletes the file
Logger.log('File ' + File.getName() + ' was deleted.');
}
"Access denied: DriveApp. (line 20, file "Code")Dismiss"
but i enabled the access in the api console and through the script editor