The method for doing this is actually part of the bmFolderFun library documented in A handier way of accessing Google Drive folders and files from Apps Script but it can be really useful for keeping your Drive clean that I thought it deserved its own article. The idea is that given a path like /data/images you should be able to easily enumnerate all files, optionally filtered by type, and optionally including any subfolders. Once you know what you have and where it is, it makes everything a lot easier to organize.
The method for doing this is actually part of the bmFolderFun library documented in A handier way of accessing Google Drive folders and files from Apps Script but it can be really useful for keeping your Drive clean that I thought it deserved its own article. The idea is that given a path like /data/images you should be able to easily enumnerate all files, optionally filtered by type, and optionally including any subfolders. Once you know what you have and where it is, it makes everything a lot easier to organize.
https://ramblings.mcpher.com/apps-script/apps-script-v8/iterators/files/