Applescript 在 Apple Mail 中选择特定收件箱
我是 Applescript 新手,遇到了一个问题。我的邮件“收件箱”中有多个文件夹。但是,我只想选择这些收件箱之一来运行脚本。
这是我所拥有的。但是,我似乎找不到 Gmail 帐户的收件箱。
有什么想法吗?
set _ago to (current date) - days
set _inbox to "Inbox:Gmail"
tell application "Mail"
move (messages of _inbox whose read status is false and date received comes before _ago) to mailbox "Gmail - Unread"
move (messages of _inbox whose date received comes before _ago) to mailbox "Gmail - Archive"
end tell
I am new to Applescript and I am running into an issue. I have multiple folder in my Mail "Inbox". However, I would like to just select one of these inboxes to run the script on it.
Here is what I have. However, I cannot seem to find the Inbox for the Gmail account.
Any ideas?
set _ago to (current date) - days
set _inbox to "Inbox:Gmail"
tell application "Mail"
move (messages of _inbox whose read status is false and date received comes before _ago) to mailbox "Gmail - Unread"
move (messages of _inbox whose date received comes before _ago) to mailbox "Gmail - Archive"
end tell
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
虽然我没有在任何地方看到过这个记录,但收件箱似乎总是名为“INBOX”的邮箱(大小写很重要)。因此,以下是我所做的当我需要访问特定于帐户的收件箱时:
这与访问任何邮箱的方式相同,只需使用此特定名称即可。另请注意,您可能还需要在
move
语句中使用帐户“Gmail”的邮箱“未读”
表单,但我不确定;你需要测试一下。It seems, although I haven't seen this documented anywhere, that inboxes are always mailboxes named "INBOX" (case matters). Thus, the following is what I do when I need to access an account-specific inbox:
It's the same way you'd access any mailbox, you just use this particular name. Note also that you might need to use the
mailbox "Unread" of account "Gmail"
form in yourmove
statements as well, but I'm not sure; you'd need to test this.