有没有办法从Goggle Calander导出颜色,并将它们发布到Goggle工作表中--我从2019年的不同网站上看到的帖子说,这种功能是不可能的,但是我用颜色来分解我的日历,我很乐意带颜色来帮助我的统计。
发布于 2022-09-19 13:07:25
您可以遵循本指南:
const sS = SpreadsheetApp.getActiveSheet()
function bringCalendarToSheet() {
// Getting the colors for the Calendar and Events
const colors = Calendar.Colors.get()
const colorsCalendar = colors.calendar
const colorsEvents = colors.event
// Parsing and setting the data for the Calendar Colors
const A1 = sS.getRange('A1').setValue('Calendar Colors')
const colorsCalendarLength = Object.keys(colorsCalendar).length
const rCC = sS.getRange(2, 1, 1, colorsCalendarLength).setBackgrounds([Object.keys(colorsCalendar).map(k => {
return colorsCalendar[k].background
})])
// Parsing and setting the data for the Event Colors
const A3 = sS.getRange('A3').setValue('Event Colors')
const colorsEventsLength = Object.keys(colorsEvents).length
const rEC = sS.getRange(4, 1, 1, colorsEventsLength).setBackgrounds(
[Object.keys(colorsEvents).map(k => {
return colorsEvents[k].background
})]
)
}这将显示所有日历可用的颜色:
结果:

https://stackoverflow.com/questions/73772600
复制相似问题