【问题标题】:AppleScript and Mail.app: checking for new messages in specific accountAppleScript 和 Mail.app:检查特定帐户中的新消息
【发布时间】:2014-10-16 09:00:06
【问题描述】:

我想在我的 zsh 提示中包含来自特定邮件帐户的新邮件数,但我只能获取邮件以返回新邮件总数。

将 output_string 设置为 ""
告诉应用程序“邮件”
将 Unread_Count 设置为收件箱的未读计数
如果 Unread_Count 为 0 则
将 output_string 设置为“0”
其他
将 output_string 设置为 ("" & (get Unread_Count))
如果结束
结束告诉
返回 Unread_Count

我尝试了其他几种方法,例如:

将 Unread_Count 设置为帐户“Gmail”的未读计数

但没有任何运气。

非常感谢您的帮助!
谢谢!

【问题讨论】:

    标签: cocoa email applescript


    【解决方案1】:

    试试:

    tell application "Mail" to set undreadMessages to messages of mailbox "INBOX" of account "my account name" whose read status = false
    

    为马库斯·里克特编辑

    tell application "Mail" to set Unread_Count to count (messages of mailbox "INBOX" of account "my account name" whose read status = false)
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-04-29
      • 2011-11-10
      • 2018-06-26
      • 1970-01-01
      • 2016-01-20
      • 1970-01-01
      • 1970-01-01
      • 2011-10-02
      相关资源
      最近更新 更多