I'm trying to create a Mail.app rule (in OS X Yosemite) using Javascript to automate instead of AppleScript, but I'm stuck in 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 donβt understand how this translates to JavaScript.
Define a function? Set callback? I do not understand.
I see that there is a function performMailActionWithMessages , but I cannot figure out how to make it work.
Any guidance is greatly appreciated!
source share