Web Apps甚至在Apps脚本将其显示为星号后仍会显示消息 [英] Web Gmail shows message as starred even after Apps Script unstars it

查看:134
本文介绍了Web Apps甚至在Apps脚本将其显示为星号后仍会显示消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好吧,我认为网络Gmail正在变得棘手。我运行了一个Google应用程序脚本,该脚本部分将我的待办事项标签添加到手动列出的任何线索,然后对其进行归档并将其打散。下面是一个片段。我会很感激任何帮助。

运行脚本后,线程会获取标签并取消注册,但web Gmail中线索/消息旁边的星形图标仍显示为选中状态。如果我转到已加星标的邮件标签/文件夹,则不显示任何内容。如果我立即重新运行该脚本,它不会找到任何已加星标的线程。这似乎表明脚本工作正常。问题似乎是,网络Gmail仍然希望将其显示为已加星标,即使它不是。 Gmail Android应用不会显示应用于该线程的明星。图片更值得...



脚本运行后,我的收件箱看起来像什么。注意:



尚未加星标讯息:

  function addStarred2ToDo(){
var threads = GmailApp.search('is:starred');
for(var h in threads){
var messages = threads [h] .getMessages();
for(var i in messages){
if(messages [i] .isStarred()){
messages [i] .unstar();




编辑:
我也尝试过这种方法,但都没有产生预期结果。

  function thisOne(){
var线程= GmailApp.search('is:starred');
for(var h in threads){
var messages = threads [h] .getMessages();
for(var i in messages){
if(messages [i] .isStarred()){
messages [i] .unstar()。refresh();




$ b函数和ThisOne(){
var threads = GmailApp.search('is:starred') ;
var toUnstar = [];
threads.forEach(function(thread){
thread.getMessages()。forEach(function(message){
if(message.isStarred()){
toUnstar.push (消息);
}
});
});
GmailApp.unstarMessages(toUnstar);


解决方案

在这位明星身上,你会看到弹出窗口显示它没有被盯住。另外,当你从gmail选择星号时,这似乎成了一个问题,因为我的过滤器设置的星号在我的脚本压缩了它们时正常工作。


OK, I think web Gmail is being screwy. I run a Google apps script that in part adds my "To-do" label to any thread I manually star, then archives and unstars it. A snippet is below. I'd appreciate any help.

After running the script the thread gets the label and is unstarred, except the star icon next to the thread/message in web Gmail still shows as selected. If I go to Starred messages label/folder nothing is displayed. If I immediately rerun the script it doesn't find any Starred threads. This seems to indicate the script is working OK. The problem seems to be that web Gmail still wants to show it as Starred even though it isn't. Gmail Android app doesn't show the star applied to the thread. Pictures are worth more...

What my inbox looks like after the script runs. Note the star:

Yet no Starred messages:

function addStarred2ToDo() {
  var threads = GmailApp.search('is:starred');
  for (var h in threads) {
    var messages = threads[h].getMessages();
    for (var i in messages) {
      if (messages[i].isStarred()) {
        messages[i].unstar();
      }
    }
  }
}

EDIT: I also tried this and neither produce what is expected.

function thisOne() {
  var threads = GmailApp.search('is:starred');
  for (var h in threads) {
    var messages = threads[h].getMessages();
    for (var i in messages) {
      if (messages[i].isStarred()) {
        messages[i].unstar().refresh();
      }
    }
  }
}

function andThisOne() {
  var threads = GmailApp.search('is:starred');
  var toUnstar = [];
  threads.forEach(function (thread) {
    thread.getMessages().forEach(function (message) {
      if (message.isStarred()) {
        toUnstar.push(message);
      }
    });
  });
  GmailApp.unstarMessages(toUnstar);
}

解决方案

If you refresh gmail and hover over the star, you will see that the popup says it is Not Stared. Also, this seems to be an issue when you select the star from gmail, as stars that are set by my filters work correctly when my script unstars them.

这篇关于Web Apps甚至在Apps脚本将其显示为星号后仍会显示消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆