我正在尝试使用Javascript for Automation而不是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
Run Code Online (Sandbox Code Playgroud)
但我不清楚这是如何转换为JavaScript的.
我定义一个函数吗?设置回调?我不清楚.
我看到有performMailActionWithMessages功能,但我无法弄清楚如何让它工作.
非常感谢任何指导!