1

我有一个脚本可以完美地检查我是否收到了带有特定主题的电子邮件(如下):

tell application "Mail"
check for new mail
repeat until (background activity count) = 0
    delay 0.5
end repeat
try
    return subject of (first message whose read status is false and subject contains "New newsletter ordered by")
end try
end tell

现在 AppleScript 拒绝阅读电子邮件的主题。任何想法为什么?我假设有一个更新破坏了它,但我找不到任何相关信息。

4

3 回答 3

0

我有一台 10.7.4 计算机,当没有找到具有这些属性的消息时出现错误。如果有包含该主题的未读邮件,则脚本(显示“收件箱的第一封邮件”的脚本)可以正常工作。

于 2012-09-15T15:55:39.330 回答
0

尝试

return subject of (first message of inbox whose read status is false and subject contains "New newsletter ordered by")
于 2012-09-13T10:43:28.923 回答
0

这似乎对我有用,我首先必须选择第一条消息,然后我才能得到主题:

tell application "Mail"
   set theInbox to inbox
   set theMessage to first message of theInbox whose read status is false
   tell front message viewer to set selected messages to {theMessage}
   set theMessages to (get selection)
   repeat with theMessage in theMessages
       get subject of theMessage as string
   end repeat
end tell
于 2012-11-06T15:20:34.490 回答