I have a list of new filenames that like to be applied to a list of files in google drive.
I have the FileID and corresponding new filenames in a google sheet (column1 with FilesIDs, column2 with the new filenames)
The solutions i found all had to do with renaming from Old-name to New-name. I'm looking for a method to rename google drive files using the FileID
What would the script look like? Many thanks in advance!
function changenames() {
const ss=SpreadsheetApp.getActive();
const sh=ss.getActiveSheet();
const dt=sh.getRange(2,1,sh.getLastRow()-1,2).getValues();
dt.forEach(function(r){DriveApp.getFileById(r[0]).setName(r[1])});
}