Hi im absolute novice with google script in general, ive been tweaking around with this script i found from Bulk convert csv files in Google drive to Google Sheets:
function convert() {
var folder = DriveApp.getFolderById('folder id here');
var files = folder.getFiles();
while (files.hasNext()) {
var file = files.next();
Drive.Files.copy({}, file.getId(), {convert: true});
}
}
and it works like a charm. the problem is that the this code indiscriminately convert every file in the said folder, including the converted file and source file. so if i run the script for the 2nd i would end up with a new copy of the converted file and another copy of the source file.
is there any way to work around this? i was thinking something along the lines of moving the converted files into a different folder and allow file overwriting to avoid copies.
thank you so much in advance.