我正在编写一个小苹果脚本,它检索查看器中的所有“未读”消息并循环它们。
我有两个目标要完成:
你知道怎么做这些吗?
提前致谢。
最佳答案
以下 applescript 对我有用,但我不确定如何进行正则表达式匹配。您可以将unix 'grep' 函数与applescript 的' do shell script
一起使用。 ' 命令,但我不是如何正确使用 grep 的专家。我将把它留给其他人来回答。
on run
tell application "Mail"
set myInbox to mailbox "INBOX" of account 1
set myMessages to every message of myInbox
repeat with theMessage in myMessages
if read status of theMessage is false then
if my subjectIsInteresting(subject of theMessage) then
open theMessage
delay 4
close window 1
end if
end if
end repeat
end tell
end run
on subjectIsInteresting(subject)
-- do some regex magic here
return true -- for now
end subjectIsInteresting
关于applescript - 如何使用applescript打开电子邮件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/390381/