Created
February 20, 2015 03:26
-
-
Save pen/430c1e74878c1870b3aa to your computer and use it in GitHub Desktop.
Google App で自分が参加しているグループをGoogleスプレッドシートにとりだすGoogle App Script
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
/* | |
* @OnlyCurrentDoc | |
*/ | |
function myFunction() { | |
var names = GroupsApp.getGroups() | |
.map(function(g) { return g.getEmail().replace(/@.*/, "") }) | |
.sort(); | |
SpreadsheetApp.getActiveSheet() | |
.clearContents() | |
.getRange(1, 1, names.length, 1) | |
.setValues(names.map(function(n) { return [ n ] })); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment