I'm starting to learn google apps script and suffering a little, :S.
So, when I run this function:
function importXLSX(){
var files = DriveApp.getFolderById('0B5HXuvZIdqQ3bWlKNXFXZzhIcmc').searchFiles('title contains ".xlsx"');
while(files.hasNext()){
var xFile = files.next();
var name = xFile.getName();
if (name.indexOf('.xlsx')){
var ID = xFile.getId();
var xBlob = xFile.getBlob();
var newFile = { title : name+'_converted',
key : ID,
}
file = Drive.Files.insert(newFile, xBlob, {
convert: true
});
}
}
}
The files converteds are set in Drive's root, but I´d like that
When I run the code, the files are saved in the root folder but I would like them to be saved to a specific folder, like "Converteds", so if anyone knows how to solve it, I would be very grateful!
This is a reference link about the function: Convert all xls files available in a folder into "Google Doc Spreadsheets"?
Thanks!