#Как закрыть модальное диалоговое окно? (836274) #SO
В примере есть меню с запуском обоих вариантов закрытия окна
Пример https://docs.google.com/spreadsheets/d/157e0M3XDTUvO1saKusi4-_YCdptozCHDKB4fHQ1pm60/edit?usp=sharing ruSO https://ru.stackoverflow.com/questions/836274
| /** | |
| * Возвращает массив сумм строк диапазонов | |
| * | |
| * @param {Sheet1!A1:C5} value Находит суммы строк заданного диапазона. | |
| * @returns { *[] } Суммы строк | |
| * @customfunction | |
| */ | |
| function SUMLINE(value) { | |
| if(!Array.isArray(value)) | |
| throw new Error( "Требуется диапазон значений" ); |
function getFiles() {
return
Drive.Files.list({
q: "'0123qwewqryuqwoiryqwieuoiuyqwe' in parents",
fields: "items(title,id,selfLink)",
maxResults: 1000
}).items.map(function(r){ return [r.title, r.id, r.selfLink]})
}Best Practices. Use batch operations
Код ниже неоптимальный, т.к. добавление строки происходит на каждой итерации цикла
/* до этого момента происходила магия */
sheet.clear(); sudo apt-get install -y libssl-dev libreadline-dev zlib1g-dev git clone https://github.com/rbenv/rbenv.git ~/.rbenvYou have to get an access to UI. For an example SpreadsheetApp.getUi().showModelessDialog ... After this call window.open then google.script.host.close(); if you need.
The example https://docs.google.com/spreadsheets/d/1Q9VFiCrbwLwqm5i2y8OJU4RsSuj8qUhocqd1YUzR1p0/copy
⚠️ The end user must also allow the popup for the given URL.
UrlFetchApp wrapper https://github.com/oshliaer/fetch
| /* | |
| * Возвращает RangeList выделенных пользователем диапазонов | |
| * @return {RangeList} | |
| **/ | |
| function getActiveRangeList() { | |
| return SpreadsheetApp.getActiveRangeList(); | |
| } | |
| /* | |
| * Возвращает html на основе выделенных пользователем диапазонов |