Привет. Я разрабатываю небольшое приложение для перемещения файлов по диску Google с помощью Google Appmaker.
У меня есть код, позволяющий выбрать файл и каталог назначения.Проблема в том, чтобы вызвать функцию сервера для запуска функций DriveApp следующим образом:
function onClickbtnMove(widget, event){
var props = widget.root.properties;
fileids=props.FileIdList;
//fileids is a list object of fileIDs, in the following text i removed the loop and just try with one fileID
var i=0;
google.script.run
.withSuccessHandler (function (result) {
console.log (result);
})
.withFailureHandler (function (error) {
console.log (error);
})
.moveFiles_(fileids[i], props.FolderDestinationId);
}
Сценарий сервера:
function moveFiles_(sourceFileId, targetFolderId) {
var file = DriveApp.getFileById(sourceFileId);
// file.getParents().next().removeFile(file); // removed until i get it working!!
DriveApp.getFolderById(targetFolderId).addFile(file);
return "1";
}
Я уверен, что что-то совершенно очевидно, но я получаю:
google.script.run.withSuccessHandler(...)
.withFailureHandler(...).moveFiles_ is not a function`
любое руководство очень приветствуется.заранее спасибо.