Display of unread mails OSX - AppleScript and Arduino

Hi everyone,
After looking into this for a few hours without any result, I decided to ask for help...

I want to use my UNO to show me how many unread emails if have within OSX Mail.

Here's what I did so far:

  • Create an AppleScript that shows me the number of unread mails
  • Create a Processing sketch that tells Arduino to blink an LED

What's missing is the link between AppleScript and Processing or a direct link between AppleScript and Arduino. I tried SerialPortX but it seems not to work with macOS Sierra. I get the message that the script does not understand the message "serialport list".

Any help would be highly appreciated.

All the best,
Steffen

When you have figured out how to get the Mac to send data to the Arduino you should have a look at the examples in Serial Input Basics - simple reliable ways to receive data.

I have no experience with Macs.

...R

Here's what I did so far:

  • Create an AppleScript that shows me the number of unread mails

Which you then modified to (try to) use SerialPortX.

but it seems not to work with macOS Sierra.

That seems extremely unlikely.

I get the message that the script does not understand the message "serialport list".

Well, it's your script. Make it understand the message, or stop sending it that message.

If you need help with the former, you probably should be asking on an Apple forum or, at a minimum, posting the script that you need help with.

PaulS:
That seems extremely unlikely.

Do you have experience with SerialPortX and newer OSX versions? I put "SerialPort X.osax" into /Library/ScriptingAdditions/

Here's an excerpt of the code where I get the error now on the serialport open command:

global myPort

on run
	
	set use_port to "/dev/cu.usbmodem1411"
	
	set myPort to serialport open use_port bps rate 9600 data bits 8 parity 0 stop bits 1 handshake 0
	
end run