1
我想写一个备份脚本将我的聊天记录传输到Google电子表格。Google App脚本将聊天记录导出到电子表格
我想写一个备份脚本将我的聊天记录传输到Google电子表格。Google App脚本将聊天记录导出到电子表格
这可能是您之前尝试的路线,尽管您尚未提供大量信息,因此很难分辨。
在GmailApp类中有返回聊天线程的方法(https://developers.google.com/apps-script/reference/gmail/gmail-app#getChatThreads()),您可以指定返回线程的最大数量和开始索引位置。
function chatThreadsExample() {
// get first 10 chat threads
var threads = GmailApp.getChatThreads(0,10);
//get first thread messages
var messages = threads[0].getMessages();
//get first thread first message contents
Logger.log(messages[0].getBody());
}
正如你可以看到每个归档聊天线程,并对其内容的电子表格是绝对有可能的,但相当密集的(这取决于有多少聊天记录有每个聊天有多长)。