Created
November 14, 2020 14:10
-
-
Save danielo515/81d5fb2d5cb6498402902c7c4020be6e to your computer and use it in GitHub Desktop.
Restore everything on google drive bin
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const recoverAll = (kind,iterator) => { | |
while (iterator.hasNext()) { | |
const next = iterator.next(); | |
next.setTrashed(false); | |
Logger.log(kind + ": " + next.getName() + " RESTORED!"); | |
} | |
} | |
function RecoverTrash() { | |
const folders = DriveApp.getTrashedFolders(); | |
recoverAll("Folders", folders) | |
Logger.log("All folders restores, going to restore individual files") | |
const files = DriveApp.getTrashedFiles(); | |
recoverAll("Files", files) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment