admin管理员组文章数量:1334133
I'm trying to build a Mail.app rule (on OS X Yosemite) using Javascript for Automation instead of AppleScript, but I'm stuck on the basics.
I see this code in 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
but I'm unclear how this translates to JavaScript.
Do I define a function? Set a callback? I'm unclear.
I see that there is the performMailActionWithMessages
function, but I can't figure out how to get it working.
Any guidance is very much appreciated!
I'm trying to build a Mail.app rule (on OS X Yosemite) using Javascript for Automation instead of AppleScript, but I'm stuck on the basics.
I see this code in 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
but I'm unclear how this translates to JavaScript.
Do I define a function? Set a callback? I'm unclear.
I see that there is the performMailActionWithMessages
function, but I can't figure out how to get it working.
Any guidance is very much appreciated!
Share Improve this question asked May 14, 2015 at 17:30 Daniel MorrisonDaniel Morrison 3111 silver badge4 bronze badges1 Answer
Reset to default 14I finally figured it out:
function performMailActionWithMessages(messages) {
messages.forEach( function(message) { // if you want to iterate
})
};
本文标签: emailMail Rules using JavaScript for Automation instead of AppleScriptStack Overflow
版权声明:本文标题:email - Mail Rules using JavaScript for Automation instead of AppleScript - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742348971a2458100.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论