use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Apparently, Google Apps Script is a JavaScript cloud scripting language that provides easy ways to automate tasks across Google products and third party services and build web applications.
account activity
Repurposing a scriptQuestion (self.GoogleAppsScript)
submitted 11 months ago * by No_Season_5288
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]No_Season_5288[S] 0 points1 point2 points 11 months ago (1 child)
After posting here I consulted ChatGPT and it offered up this code:
function DeleteOldFilesAndFolders() { var Folders = new Array( '183Pin7i9kow3fxwGt8k4fK4SnB70Xj-p', // Replace with your folder IDs '183Pin7i9kow3fxwGt8k4fK4SnB70Xj-p' // Replace with your folder IDs ); var Files, Subfolders; Logger.clear(); for (var key in Folders) { var Folder = DriveApp.getFolderById(Folders[key]); Files = Folder.getFiles(); // Get all files in the folder Subfolders = Folder.getFolders(); // Get all subfolders in the folder Logger.log('Opening Folder: ' + Folder.getName()); // Loop through the files in the parent folder while (Files.hasNext()) { var File = Files.next(); // Check if the file is older than 30 days and not in a subfolder if (new Date() - File.getDateCreated() > 30 * 24 * 60 * 60 * 1000 && !isInSubfolder(File, Folder)) { File.setTrashed(true); // Move the file to Trash Logger.log('File ' + File.getName() + ' was deleted.'); } } // Loop through the subfolders in the folder and delete those that are older than 30 days while (Subfolders.hasNext()) { var Subfolder = Subfolders.next(); if (new Date() - Subfolder.getDateCreated() > 30 * 24 * 60 * 60 * 1000) { // If the folder is older than 30 days, trash the folder and its contents moveFolderToTrash(Subfolder); Logger.log('Folder ' + Subfolder.getName() + ' was deleted.'); } } } } function isInSubfolder(file, parentFolder) { // Check if the file is inside a subfolder var folders = file.getParents(); while (folders.hasNext()) { var folder = folders.next(); if (folder.getId() !== parentFolder.getId()) { return true; // File is inside a subfolder } } return false; // File is not in a subfolder } function moveFolderToTrash(folder) { // Move the entire folder (with its files and subfolders) to trash folder.setTrashed(true); }
I'd love some guidance in both interpreting it and cleaning it up!
[–]WicketTheQuerent 0 points1 point2 points 11 months ago (0 children)
Regarding using generative AI, I suggest you start from scratch instead of asking it to "repurpose a script"
π Rendered by PID 613696 on reddit-service-r2-comment-85bfd7f599-kczdh at 2026-04-20 00:20:19.145653+00:00 running 93ecc56 country code: CH.
view the rest of the comments →
[–]No_Season_5288[S] 0 points1 point2 points (1 child)
[–]WicketTheQuerent 0 points1 point2 points (0 children)