I may have silly question but I can't find a solution
I have go through a lot of files in my google drive and inside every file there is a number within 0-10000 range, so I made this:
for(var i = 0; i < 10000; i++)
{
var test = "IT" + i;
Logger.log(test);
var search = DriveApp.getFolderById("ID")
.searchFiles('fullText contains test');
Logger.log(search);
while (search.hasNext()) {
var file = search.next();
if(search.hasNext())
break;
Logger.log(file.getName());
}
...
My question is, how can I put a variable like this:
.searchFiles('fullText contains $variable');
so that I can use the value of the variable test, i.e. "IT0", rather than the literal string test?
.searchFiles('fullText contains ' + yourVariable);searchFiles('fullText contains "IT"' + test)- Didn't work. I am getting error: Invalid argument: q (line 18, file "test")