/**
* Lists the user's filters, including criteria, action,
* and ID information to a spreadsheet
*/
function listFilterInfo() {
var sheet = SpreadsheetApp.openById(SSID).getSheetByName('Filters'); sheet.clear();
var response =
Gmail.Users.Settings.Filters.list('me')
for (var i = 0; i < response.filter.length; i++) {
var filter = response.filter[i];
sheet.appendRow([i, filter.criteria, filter.action]); Logger.log(JSON.stringify(filter));
}
}