the objective is to get all files of SCRIPT type from Google Drive; & in a loop get their text contents one by one.
My code is:
function searchFiles() {
//https://developers.google.com/apps-script/reference/base/mime-type
var type = MimeType.GOOGLE_APPS_SCRIPT;
var files = DriveApp.getFilesByType(type);
while (files.hasNext()) {
var file = files.next();
process(file);
}
}
function process(file){
//https://developers.google.com/apps-script/reference/base/mime-type
var txt = file.getBlob(PLAIN_TEXT);
Logger.log(txt);
}
The error I get from file.getBlob() is: Converting from application/vnd.google-apps.script to application/pdf is not supported.
I have also tried the FetchURL for file.getUrl()
but that too just gives the whole HTML for file if I open in same window as I am logged in & Error Page HTML if opened in incognito.
Is it possible to get text contents of a script file in Google Apps Script?