I have a Google Apps Script function SearchFiles() which returns the download urls depending on the keyword the user provides. It is something like this:
function SearchFiles(inputValueFromUser) {
var searchFor ='title contains "' + inputValueFromUser + '"';
var searchForAbsString = inputValueFromUser + '.pdf' ;
//The Rest of the Code goes here
if(file.getName() == searchForAbsString){
downloadURL = "https://drive.google.com/uc?export=download&id=" + fileId;
arryOfUrls.push(downloadURL);
};
};
Logger.log('arryOfUrls: ' + arryOfUrls);
return arryOfUrls;//.toString(); //Send array of download urls back to client side JavaScript
};
The function is returning arryOfUrls in plain text.
1) How can it be sent in hyperlink form?
2) Is it possible to open the URL automatically(start download immediately) as one clicks the respective button( on Index.html) to get the link?