Script to check certain MAC address in wireless reg table and email?

:if ([/interface wireless registration-table find mac-address = AA:BB:7E:G3:92:76]= 1) do={/tool e-mail send to=“XXX@gmail.com” \ subject=“XXX is online”\ body=“Checked just now” }

I tried the above but it didn’t work. So how do I write a script to tell the router to check the wireless reg table for a mac address, and when it’s found (means that device is online) then send me an email about it?

Thank you for any help!