So I have the script below which allows me to automatically create google drive hyperlinks of files within the same directory:
function myFunction() {
var ss=SpreadsheetApp.getActiveSpreadsheet();
var s=ss.getActiveSheet();
var c=s.getActiveCell();
var fldr=DriveApp.getFolderById(*[insert id]*);
var files=fldr.getFiles();
var names=[],f,str;
while (files.hasNext()) {
f=files.next();
str='=hyperlink("' + f.getUrl() + '")';
str2 = f.getName();
names.push([str2,str]);
}
s.getRange(c.getRow(),c.getColumn(),names.length,2).setValues(names);
}
I am very novice, however, so I can't really figure out how I would get this to search through each of the subfolders as well to get their hyperlinks too. I feel as if this is probably relatively simple, but I am not well versed enough in google scripts to do this (if it was python, I could do this easily). Any help would be greatly appreciated.