我正在尝试使用 Javascript 自动化而不是 AppleScript 构建 Mail.app 规则(在 OS X Yosemite 上),但我停留在基础知识上。
我在 AppleScript 中看到这段代码:
using terms from application "Mail"
on perform mail action with messages theMessages for rule theRule
# actual code here
end perform mail action with messages
end using terms from
但我不清楚这如何转化为 JavaScript。
我定义一个函数吗?设置回调?我不清楚。
我看到有performMailActionWithMessages
功能,但我不知道如何让它工作。
非常感谢任何指导!
我终于弄明白了:
function performMailActionWithMessages(messages) {
messages.forEach( function(message) { // if you want to iterate
})
};
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)