【发布时间】:2012-02-10 21:06:13
【问题描述】:
作为学习 Applescipt 的借口,我编写了一个脚本以附加到邮件规则以过滤消息。我四处寻找并整理了这么多代码:
on perform_mail_action(theData)
tell application "Mail"
set theSelectedMessages to |SelectedMessages| of theData
set theRule to |Rule| of theData
repeat with a from 1 to count theSelectedMessages
set theMessages to selection
set theMessage to item 1 of theMessages
end repeat
end tell
end perform_mail_action
我原以为规则只会传递一条消息,但你永远不知道,所以重复是有意义的。我认为“选择”是指向 theSelectedMessages 中的项目的指针。看起来很奇怪的是“将 theMessage 设置为 theMessages 的第 1 项”。我原以为您会编写“将消息设置为选择”的代码。我想获取消息的正文“内容”来测试某些单词。
感谢您的帮助, 生硬
【问题讨论】:
标签: email applescript