[英]AppleScript and Mail.app: checking for new messages in specific account
我想在zsh提示符中包括来自特定邮件帐户的新邮件数量,但是我只能获取邮件以返回新邮件的总数。
将output_string设置为“”
告诉应用程序“邮件”
将Unread_Count设置为收件箱的未读计数
如果Unread_Count为0,则
将output_string设置为“ 0”
其他
将output_string设置为(“”&(获取Unread_Count))
万一
结束告诉
返回Unread_Count
我尝试了其他几种方法,例如:
将Unread_Count设置为帐户“ Gmail”的未读计数
但没有运气。
多谢您的协助!
谢谢!
尝试:
tell application "Mail" to set undreadMessages to messages of mailbox "INBOX" of account "my account name" whose read status = false
编辑马库斯·里克特(Marcus Rickert)
tell application "Mail" to set Unread_Count to count (messages of mailbox "INBOX" of account "my account name" whose read status = false)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.