Created
September 30, 2020 12:50
-
-
Save cooltables/325a8ccdf8e0bc50ba117816416461cd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getSheets() { | |
// Получить текущую книгу в переменную file | |
var file = SpreadsheetApp.getActive(); | |
// Получить все листы | |
var sheets = file.getSheets(); | |
// Объявить результат, и лист | |
var result = [], sheet; | |
// Пройтись по всем листам и записать результат | |
for (var i = 0; i < sheets.length; i++) { | |
// Назначить лист | |
sheet = sheets[i]; | |
// Добавить в результат имя листа и айди листа | |
result.push([sheet.getName(), sheet.getSheetId()]); | |
} | |
// Вернуть результат | |
return result; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment