I need to convert docx files inside a folder and place the created GDocs file beside the .docx as the same name without .docx extension
I do not want to use folder.addFile(doc);DriveApp.getRootFolder().removeFile(doc) because its a overhead and I want to place the file in the folder itself rather than creating the converted file in root and then moving it besides docx.
I have tried with
function myFunction() {
var docx = DriveApp.getFilesByName('Dummy.docx').next();
var newDoc = Drive.newFile();
var blob =docx.getBlob();
var file=Drive.Files.insert(newDoc,blob,{convert:true});
DocumentApp.openById(file.id).setName(docx.getName());
}